Determine which page has focus.

MsfStl

Registered User.
Local time
Today, 00:59
Joined
Aug 31, 2004
Messages
74
Hi,
I have a form with 8 pages (tabs) on it. Each page has a Quit button which populates both a Form name variable and a Question name variable. When a user clicks the quit button the code forces the page name associated with the quit button. I would like to try and catch the same information if someone clicks the DB Close button(s) at the top of the screen. How can I programatically determine what page was/is open when the close db button was clicked? I guess I could create a switch that is populated when a page has focus and then call the last switch value. But I think that seems like extra programming, if I can just call the current page name/index. Is there something like the form name?
E.G.:

MyForm = Me.Form.Name

maybe an active page index or something? The problem is I won't know what page is opened at the time a close button is clicked unless I use a switch of some sort.

Thanks.
 
Tabs

If your tab control's name is TabCtl0 then ...
Each tab has a value going from left to right of 0,1,2,etc...


If Me.TabCtl0.Value = 2 Then
'tab 3 has the focus
whatever you want to code here..............
end if

Hope this helps
 
Last edited:
Ahh, i see (said the blind man). With that I can then force the page name based upon the tab value. Or, is there a way for me to call the caption of the tab with focus? I am asking because I use the name in a dialogue box elsewhere and the tab index would sail over the user's head. If not that's cool, you definitely gave me enough info to work this out. Thanks!
 
Tabs

if Me.TabCtl0.Value = 2 Then
me.whateverfieldyouwant=me.page3.caption
end if


Don't know if that is what you wanted
 
actually all I need I think is :
me.whateverfieldyouwant=me.page3.caption

It should pull what ever caption from the tab that has focus correct? I'll play with it and see. If so then I don't have to run through the quasi select case mode. of course that would work too. That's the beauty (and the beast) about programming; there are many different ways to code the same action.

Thanks again.
 

Users who are viewing this thread

Back
Top Bottom