how dynamically change caption of TabControl page (1 Viewer)

eugzl

Member
Local time
Today, 05:40
Joined
Oct 26, 2021
Messages
125
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
 

tvanstiphout

Active member
Local time
Today, 02:40
Joined
Jan 22, 2016
Messages
222
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.
 

eugzl

Member
Local time
Today, 05:40
Joined
Oct 26, 2021
Messages
125
Hi tvanstiphout. Thanks for reply.
It works fine. Thank you so much.
 

Users who are viewing this thread

Top Bottom