Avatar of wlwebb
wlwebb
Flag for United States of America asked on

VB - TabControl - SubForm - do some code ONLY If it is the Active tab subform

Hello again.

I have a Form with a TabControl.  On that TabControl I have 7 or 8 pages and each page will have 1 to 4 Main subforms (not of each other - just of that Page of the TabControl.

I have some code that I only want to execute IF and only if a particular page and it's sub form are the ACTIVE tab that the user is viewing.

I have tried "If xxxx.visible=true then" but even though at the time I execute the doubleclick the form isn't visible because I have the Page set to visible = no at should have run it sees that the subform is "visible" so it does the 'then' and not the 'else' steps.

Any suggestion of another control trigger I can use... (also tried using a txtwait textbox's Got Focus and it didn't do the trick for me.)
Microsoft Access

Avatar of undefined
Last Comment
wlwebb

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Rey Obrero (Capricorn1)

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
wlwebb

ASKER
Are the "Case" 's the Page Numbers of each Tab???  I know they actually start at 0 that's why I'm wondering if
Case 0 means something like in english

"in case 0 changed then do this code"
"in Case 1 changed then do that code"

meaning where "Page 0 (tab) changed" or
where "Page 1 (tab) changed" etc...

Am I understanding that right?
wlwebb

ASKER
Cool!....

Just tested the theory with Msgboxes.........  "I see said the blind man"

Thank you for the quick response
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23