TabControl.Value from within a subform on the Tab Control?

Clan_Destine

New member
Local time
Yesterday, 19:45
Joined
Mar 20, 2012
Messages
1
Hi everyone,

I currently have a Tab Control with 4 tabs. Each tab has a subform on it and each subform has some VBA that executes on certain events (most notably On_Exit).

I encounter a problem, however, when I close the Tab Control -- "The expression On Exit you entered as the event property setting produced the following error: There is no filed named 'X' in the current record."

*NOTE* - 'X' is the name of an object located within another subform on another Page of the Tab Control.

-- My Hypothesis --
The best guess I have is that the On Exit Event of the subforms runs when I close the Tab Control. When this happens, the error occurs in the vba of the subforms that are NOT located in the current page. If the subform is not in the current page, I would guess that it cannot access its objects.

-- My Theoretical Solution --
I would like to add an If Statement to each On Exit event in these subforms that uses this logic:
If TabControl.Value = [Index Value that corresponds to Tab Control Page that contains the subform] Then [continue with On Exit Work]

-- What I Have Tried --
I have tried adding the if statement in the vba for the subform, but it gives the error "TabControl is not defined".

----------
Is it possible to access the TabControl.Value from within the VBA of the subform?

Thank you for your help -- I hope I have asked the question responsibly,
Clan_Destine
 
Send a short example of your MDB, (Access2000 or 2002-2003).
 

Users who are viewing this thread

Back
Top Bottom