'On click' for tabbed control page never triggers ???

G

Guest

I'm having a really hard time with my tabbed controls

I have a tabbed control and I need to do certain processing when each tab is clicked. I have an event set up for the 'on click' but it never triggers. Why
I need to be able to change the appearance of the page before it displays

One one tab I have another tabbed control inside a subform.
The 'On focus' event for the form never triggers either. Why
All that triggers is the 'on focus' for the first control on this form. But I cant use that because the form is already displayed.
 
D

Dirk Goldgar

David said:
I'm having a really hard time with my tabbed controls.

I have a tabbed control and I need to do certain processing when each
tab is clicked. I have an event set up for the 'on click' but it
never triggers. Why? I need to be able to change the appearance of
the page before it displays.

One one tab I have another tabbed control inside a subform.
The 'On focus' event for the form never triggers either. Why ?
All that triggers is the 'on focus' for the first control on this
form. But I cant use that because the form is already displayed.

The Click event of a tab control *only* fires when the border of the tab
control is clicked, and therefore is the wrong event to use for your
purpose (or any other I can think of, for that matter). It's the tab
control's Change event you want to use. The Change event fires whenever
the control switches to a new page, and the Value of the tab control is
the page index of that page.

The GotFocus event of a form can only fire if there is no control on the
form capable of receiving the focus, because the form itself can only
get the focus in that circumstance.
 
G

Guest

Thanks for the reply

As I understand it, the Change event does not trigger until the page has been displayed. I need to change the page before it is displayed. Is there any way to do this or must I get rid of my subform and enclosed tab control and open up a completely different form

The design of my system relies on the fact that when a tab is clicked the resulting page can be dynamically formatted before it is displayed. What I really need is an 'open page' event

Or is there any way to prevent my subform from opening when the main form is opened and only open it when the tab is clicked?
 
D

Dirk Goldgar

David said:
Thanks for the reply.

As I understand it, the Change event does not trigger until the page
has been displayed. I need to change the page before it is displayed.
Is there any way to do this or must I get rid of my subform and
enclosed tab control and open up a completely different form?

Depending on how long it takes to make your changes, you may find the
Change event works for your purposes. Or you may be able to freeze the
screen by setting Echo False while you make your changes, and then
setting Echo True again when you're done.
The design of my system relies on the fact that when a tab is clicked
the resulting page can be dynamically formatted before it is
displayed. What I really need is an 'open page' event.

Or is there any way to prevent my subform from opening when the main
form is opened and only open it when the tab is clicked?

You can (a) leave it invisible until after you've manipulated it in the
Change event -- this will let it load but not let it be seen -- or (b)
set the subform's SourceObject in the Change event -- that would be the
equivalent of only opening the subform when the tab is clicked. or you
could combine these two techniques.
 
G

Guest

Thanks for the suggestions

My subform does not have any source object, the only reason I am using it is to contain a nested tab control. However, the subform is still opening when the main form is opening i.e the 'open event' is being triggered.
 
D

Dirk Goldgar

David said:
Thanks for the suggestions.

My subform does not have any source object, the only reason I am
using it is to contain a nested tab control. However, the subform is
still opening when the main form is opening i.e the 'open event' is
being triggered.

The subform *control* on the main form does have a Source Object, which
is the form object that you are using as a subform. This is the Source
Object I was talking about. If you leave the subform control's
SourceObject property set to the name of a form, then that form's Open
event will fire before the main form's Open event -- that is, subforms
open first. However, if you leave the SourceObject property blank, then
the subform will not be loaded when the main form opens. It will only
be opened when you set the SourceObject property.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top