msgbox for page

  • Thread starter Thread starter Rohan via AccessMonster.com
  • Start date Start date
R

Rohan via AccessMonster.com

I have a tab control with subforms on each page. I want a msgbox to pop
up when the user clicks on a certain tab. Once only would be the best.

Any clues ?

Rohan.
 
In the tab control's Change event (named "On Change" in the Properties tab),
put code to check the value of the tab control itself. It'll be 0 for the
first tab, 1 for the second tab and so on.

You can declare a static variable in the procedure to keep track of whether
or not you've already shown the message box.

For example, the following code assumes that the tab control is named
tabMain, and that you want the message to appear the first time the user
clicks on the 2nd tab:

Private Sub tabMain_Change()
Static booAlreadyShown As Boolean

If Me.tabMain = 1 And booAlreadyShown = False Then
MsgBox "You've clicked on " & Me.tabMain
booAlreadyShown = True
End If

End Sub
 
Douglas said:
In the tab control's Change event (named "On Change" in the Properties tab),
put code to check the value of the tab control itself. It'll be 0 for the
first tab, 1 for the second tab and so on.

Works a treat - thank you.

Rohan.
 
Back
Top