Dynamic Tab Names on Access Form?

ARW17

Board Regular
Joined
Oct 31, 2016
Messages
109
What I'd like to do is show employees their schedule for the week to come. My thought is to have them enter the date of their choice and then have tab 1 show their schedule for that date, have tab 2 show their schedule for the next day, etc. I'd have the same subform on each of the tabs, it would just update by day. Is it possible to have the tabs change names in this way?
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Figured it out: VBA
My tab names are Today, TodayPlus1,...TodayPlus4. You won't need most of this code if you want to include Saturday and Sunday. I got rid of them.

'Name Tabs by date
Today.Caption = (Format([TxtBxDate], "dddd mm/dd"))
TodayPlus1.Caption = (IIf(Weekday([TxtBxDate]) = 6, Format(DateAdd("d", 3, [TxtBxDate]), "dddd mm/dd"), Format(DateAdd("d", 1, [TxtBxDate]), "dddd mm/dd")))
TodayPlus2.Caption = (IIf(Weekday([TxtBxDate]) = 6, Format(DateAdd("d", 4, [TxtBxDate]), "dddd mm/dd"), IIf(Weekday([TxtBxDate]) = 5, Format(DateAdd("d", 4, [TxtBxDate]), "dddd mm/dd"), Format(DateAdd("d", 2, [TxtBxDate]), "dddd mm/dd"))))
TodayPlus3.Caption = (IIf(Weekday([TxtBxDate]) = 6, Format(DateAdd("d", 5, [TxtBxDate]), "dddd mm/dd"), IIf(Weekday([TxtBxDate]) = 5, Format(DateAdd("d", 5, [TxtBxDate]), "dddd mm/dd"), IIf(Weekday([TxtBxDate]) = 4, Format(DateAdd("d", 5, [TxtBxDate]), "dddd mm/dd"), Format(DateAdd("d", 3, [TxtBxDate]), "dddd mm/dd")))))
TodayPlus4.Caption = (IIf(Weekday([TxtBxDate]) = 6, Format(DateAdd("d", 6, [TxtBxDate]), "dddd mm/dd"), IIf(Weekday([TxtBxDate]) = 5, Format(DateAdd("d", 6, [TxtBxDate]), "dddd mm/dd"), IIf(Weekday([TxtBxDate]) = 4, Format(DateAdd("d", 6, [TxtBxDate]), "dddd mm/dd"), IIf(Weekday([TxtBxDate]) = 3, Format(DateAdd("d", 6, [TxtBxDate]), "dddd mm/dd"), Format(DateAdd("d", 4, [TxtBxDate]), "dddd mm/dd"))))))
End Sub
 
Upvote 0

Forum statistics

Threads
1,216,074
Messages
6,128,653
Members
449,462
Latest member
Chislobog

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top