"on tab" event

  • Thread starter Thread starter Bill H.
  • Start date Start date
B

Bill H.

How do I use a form with tabs so that a particular action executes only when
the user clicks on a particular tab, and/or advances to the next/previous
record while already on that tab?

I tried the onclick event, but that didn't seem to do anything.

Thanks.
 
Bill said:
How do I use a form with tabs so that a particular action executes only when
the user clicks on a particular tab, and/or advances to the next/previous
record while already on that tab?

Huh? You cannot click a tab and navigate record in one action. Or, if
that has been made possible because you use the click as navigation,
that looks like an interface design error to me.

Use the Change event of the tabcontrol to see whether a new tab was chosen.

TBH, I don't exactly understand your question; what action do you have
in mind, and why should it execute only then?
 
How do I use a form with tabs so that a particular action executes only when
the user clicks on a particular tab, and/or advances to the next/previous
record while already on that tab?

I tried the onclick event, but that didn't seem to do anything.

Thanks.

Use the Tab Control's Change event. (Click fires when the user clicks
on the face of the tab page, outside any control - and it's not much
use).
 
John said:
Use the Tab Control's Change event. (Click fires when the user clicks
on the face of the tab page, outside any control - and it's not much
use).

Well, if you like to anny users with popups like "Hey! Don't click here,
it isn't much use!" ... <nasty grin> and then buttons OK and Cancel that
change place when you mouseover... People wish they could get the
Basterd Operater out of Hell back when they see this of me...

Seriously, now and then I create these little formies, just to 'keep the
wrists loose'
 
Well, if you like to anny users with popups like "Hey! Don't click here,
it isn't much use!" ... <nasty grin> and then buttons OK and Cancel that
change place when you mouseover... People wish they could get the
Basterd Operater out of Hell back when they see this of me...

Seriously, now and then I create these little formies, just to 'keep the
wrists loose'

You're a cruel man, Bas!

I'd guess back in the DOS days you created some of those apps where
the user would type something innocuous like DIR and get a message
"Formatting drive C:, all data will be erased"...

Of course I'd have the message box say something like "Ooooh, that
feels good... click just a little lower please..."
 
John said:
You're a cruel man, Bas!

I'd guess back in the DOS days you created some of those apps where
the user would type something innocuous like DIR and get a message
"Formatting drive C:, all data will be erased"...

ROTFL

But HOW did you know THAT?

ROTFL
Of course I'd have the message box say something like "Ooooh, that
feels good... click just a little lower please..."

That is also a nice thread to follow...
 
Well, that particular tab has a subform on it, and I want to run some code
to check certain values and alert the user if the values are outside a
certain range.

Right now, I have the test in the main form's "on current" event, which
means it fires even if the user is NOT on that particular tab.

To avoid annoying the user, I want the validation vba to run ONLY when the
user navigates to that tab, or if already on that tab, if they move forward
or backward in the table.
 
Bill H. said:
I don't see where the change event is.

Can you specify?

Make sure you select the TabControl (not a page) and then look at the events tab
of the property sheet.
 
Bill said:
Well, that particular tab has a subform on it, and I want to run some code
to check certain values and alert the user if the values are outside a
certain range.

Right now, I have the test in the main form's "on current" event, which
means it fires even if the user is NOT on that particular tab.

To avoid annoying the user, I want the validation vba to run ONLY when the
user navigates to that tab, or if already on that tab, if they move forward
or backward in the table.

Sure! Good practice.
You can check the Value property of the tabcontrol from code; it is the
number of the active tab. Mind the numbering start at 0 (er, how do you
put this grammatically correct? ;-) )
 
Back
Top