Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / April 2006

Tip: Looking for answers? Try searching our database.

msgbox for page

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rohan - 04 Apr 2006 00:11 GMT
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.
Douglas J. Steele - 04 Apr 2006 00:38 GMT
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

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)

>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.
Rohan - 04 Apr 2006 01:12 GMT
>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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.