Access tab control and Ctrl-Tab

K

Kenny-Z

(Repost from microsoft.public.access.gettingstarted, Sunday, August
03)

I use and Access 2000 tab control with tab style 'none', command
buttons and VBA for a wizard. The problem is that Ctrl-Tab will change
the tab control value (page) when it (or child control) has focus. Any
suggestions?

thanks,

kz
 
J

Joe Fallon

I use the same style for one of my apps.
I have to confess I never noticed that behavior.

I took a quick look at it and noticed:
1. When I click on the first button and then Ctrl-Tab the focus moves from
button to button but the page does not change. (This is good.)

2. After the LAST button, Ctrl-Tab moves focus to the Tab Contro itself (I
think - didn't really verify.)
But from that point on, Ctrl-Tab caused the screens to change just as if the
user clicked the buttons, but the buttons were all "wrong" for the current
screen. (This is very bad.)

3. The Tab change event fires when you Ctrl-Tab past the last button.
Aha! We can intercept the event and fix things!

Private Sub TabCtrlName_Change()
Me!TabCtrlName.Value = 0
Call HandlePages
Me![pge1].Value = True
End Sub

In this case I assumed page 1 (index 0) should always be presented so I set
the focus there and popped up all buttons in HandlePages and then pressed
page1 button. (All invisible to the user. The screen just stayes the same.)
 
K

Kenny-Z

Joe Fallon said:
I use the same style for one of my apps.
I have to confess I never noticed that behavior.

I took a quick look at it and noticed:
1. When I click on the first button and then Ctrl-Tab the focus moves from
button to button but the page does not change. (This is good.)

2. After the LAST button, Ctrl-Tab moves focus to the Tab Contro itself (I
think - didn't really verify.)
But from that point on, Ctrl-Tab caused the screens to change just as if the
user clicked the buttons, but the buttons were all "wrong" for the current
screen. (This is very bad.)

3. The Tab change event fires when you Ctrl-Tab past the last button.
Aha! We can intercept the event and fix things!

Maybe I'm not following your scenario perfectly, but thanks for the
suggestions.
One of my attempted solutions was to try intercepting the tab control
change event, however, my command buttons (Back, Next, etc.) change
the tab ctl programmatically, firing the event also.

I'm guessing your HandlePages routine sets the button (and other
control) states for the given page. Perhaps this would be a work
around I could try (again).

regards,

Ken
Private Sub TabCtrlName_Change()
Me!TabCtrlName.Value = 0
Call HandlePages
Me![pge1].Value = True
End Sub

In this case I assumed page 1 (index 0) should always be presented so I set
the focus there and popped up all buttons in HandlePages and then pressed
page1 button. (All invisible to the user. The screen just stayes the same.)
--
Joe Fallon
Access MVP



Kenny-Z said:
(Repost from microsoft.public.access.gettingstarted, Sunday, August
03)

I use and Access 2000 tab control with tab style 'none', command
buttons and VBA for a wizard. The problem is that Ctrl-Tab will change
the tab control value (page) when it (or child control) has focus. Any
suggestions?

thanks,

kz
 
J

Joe Fallon

You guess is correct.
I didn't explain it very clearly, but I thought we had the same situation so
you would see what I was getting at.
I have 5 buttons that act as Tabs.
The click event of each button calls HandlePages which just re-sets them
all.
(Pops the buttons "up").
Then the click event of the current button pushes in the current button and
activates the correct Tab page.
--
Joe Fallon
Access MVP



Kenny-Z said:
Joe Fallon said:
I use the same style for one of my apps.
I have to confess I never noticed that behavior.

I took a quick look at it and noticed:
1. When I click on the first button and then Ctrl-Tab the focus moves from
button to button but the page does not change. (This is good.)

2. After the LAST button, Ctrl-Tab moves focus to the Tab Contro itself (I
think - didn't really verify.)
But from that point on, Ctrl-Tab caused the screens to change just as if the
user clicked the buttons, but the buttons were all "wrong" for the current
screen. (This is very bad.)

3. The Tab change event fires when you Ctrl-Tab past the last button.
Aha! We can intercept the event and fix things!

Maybe I'm not following your scenario perfectly, but thanks for the
suggestions.
One of my attempted solutions was to try intercepting the tab control
change event, however, my command buttons (Back, Next, etc.) change
the tab ctl programmatically, firing the event also.

I'm guessing your HandlePages routine sets the button (and other
control) states for the given page. Perhaps this would be a work
around I could try (again).

regards,

Ken
Private Sub TabCtrlName_Change()
Me!TabCtrlName.Value = 0
Call HandlePages
Me![pge1].Value = True
End Sub

In this case I assumed page 1 (index 0) should always be presented so I set
the focus there and popped up all buttons in HandlePages and then pressed
page1 button. (All invisible to the user. The screen just stayes the same.)
--
Joe Fallon
Access MVP



Kenny-Z said:
(Repost from microsoft.public.access.gettingstarted, Sunday, August
03)

I use and Access 2000 tab control with tab style 'none', command
buttons and VBA for a wizard. The problem is that Ctrl-Tab will change
the tab control value (page) when it (or child control) has focus. Any
suggestions?

thanks,

kz
 

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