Flagging the page of an "onglet" control to use it as default

Alexandre

Registered User.
Local time
Today, 22:01
Joined
Feb 22, 2001
Messages
791
Well, I posted this one in the Forms forum but had no success, so...

I created an "Onglet" control on a form (sorry, but I don t know the translation in English: it is the ActiveX control allowing to switch between different pages in a same form).

My problem is that each time that the user switches to another record of the form, Access displays back the first page of the control. I would like it to keep displaying the last edited page of the control instead.

I guess it should be possible by programatically changing the display order of the pages using event procedures, but is there a simplier/another way to?

I was working on flagging the last used page (saving the page number in a table, then reloading it OnCurrent) but realized that then the default page would be loaded first, and only the changed afterwards. Too heavy in my case: it already takes 3-4 sec to display new record in my form due to its complexity... I can t double that.

Thank you in advance for any suggestion!
 
Keep track of the page that you're on, then when the OnCurrent event fires, jump the page you want.

For multi-page forms, I place a control on each pages that allows me to setfocus to that control and show a particular page. that's considerable easier that and activeX control.
 
Bonjour, Alexandre,

Voilà comment il faut faire:

1.) you create a module-wide variable
mLastOnglet
2.) you use the OnCurrent event of the form like follows:
me!OngletName.value = mLastOnglet
3.) you use the OnOpen event of the form as follows:
mLastOnglet=0
(la première page du contrôle onglet)
Tab controls are zero-based.
 
Ok, I am at work on it now!
Thanks everybody.
Merci Els.
 

Users who are viewing this thread

Back
Top Bottom