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

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
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,223,714
Messages
6,174,052
Members
452,542
Latest member
Bricklin

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