Tab Control to mark page (1 Viewer)

databasedonr

Registered User.
Local time
Today, 04:30
Joined
Feb 13, 2003
Messages
163
Hi folks,
I've searched through the forums and found a little on tab controls, but haven't been able to figure out what I am trying to do.

I have a form with mutliple tabs, each of which contains a subform related to the form on the first tab.

When I am scrolling through the records, I might select the fourth or fifth tab to view that subform, and then, when I scroll to the next record (using the nav bar) I want to stay on that tab... but so far, my form always defaults back to the first tab.

Any suggestions on how I can keep the form open on the tab that has the focus would be a great help. Thanking all readers in advance....

Don
 

llkhoutx

Registered User.
Local time
Today, 03:30
Joined
Feb 26, 2001
Messages
4,018
Can't tell exactly what's wrong from the info you give, but there's apparently an OnCurrent event which is changing (setting focus) to the first tab.
 

databasedonr

Registered User.
Local time
Today, 04:30
Joined
Feb 13, 2003
Messages
163
Well, as best as I can figure, the act of moving to the next record fires the tab control onchange event and moves me back to the page indexed as 0. As near as I can tell, there is nothing in my code in the form oncurrent event that does this .... I've trapped the tabcontrol.value in a global variable, but moving the record fires that event and resets the tabcontrol.value to zero. ???
 

llkhoutx

Registered User.
Local time
Today, 03:30
Joined
Feb 26, 2001
Messages
4,018
Merely moving to a new record cannot cause such a change. Something else is going on.

How many different records/tables are displayed on your various tabs? If the same record is anlso displayed on another tab, maybe there an OnCurrent event there.

How man tables have data displayed on the tab visible on the Oncurrent event. Debug that event.

Did you use the debugger to follow what happen on the OnCurrent event?

Look for a command changing control to the first tab; maybe a setfocus, a docmd.gotocontrol.

Look at all the code for the form, no just the one tab.
 

databasedonr

Registered User.
Local time
Today, 04:30
Joined
Feb 13, 2003
Messages
163
Thanks for helping out, this had me baffled....

Deep in my code..., written a long time ago in a galaxy far far away, I had written a little piece to enable/disable a command button....

Thanks for sticking with me.

I thought I had the right approach, only one oncurrent event on the main form, but that little bit of code cost me a bunch of time. Thanks again. I'd like to blame it on all the turkey over the holidays, but I think the turkey's sitting at the keyboard. This now works a treat - and thank you again.
 

Users who are viewing this thread

Top Bottom