how dynamically change caption of TabControl page

eugzl

Member
Local time
Yesterday, 23:06
Joined
Oct 26, 2021
Messages
127
Hi All.
In the form I have 2 command buttons cmdPrevious and cmdNext. Also 2 text fields txtMonday and txtFriday. When I click one of the buttons, txtMonday and txtFriday get the previous week's or next week's dates: Monday and Friday. Now I would like to create a script, when the date value of txtMonday or txtFriday changes to the previous or next month, then the caption of the TabControl page will get the value of the certain month. If possible, how to do it?

Thanks
 
I'm assuming you have VBA code in the buttons' click events to calculate the date.
You can add one line:
Me.myTabControlName.myPageName.Caption = Format(Me.txtMonday, "mmmm")

Of course the Monday and Friday of a week can be in different months, so you will have to choose which one takes precedence.
 
Hi tvanstiphout. Thanks for reply.
It works fine. Thank you so much.
 

Users who are viewing this thread

Back
Top Bottom