tab requires double click with exit event

pbuethe

Returning User
Local time
Yesterday, 19:12
Joined
Apr 9, 2002
Messages
210
I have a form with 4 tabs. The OnCurrent event of the form sets the focus on the first tab. The first control on the first tab (control #1) has an exit event procedure, which sets the focus to the second control after (skipping the next control). Therefore after going to a new record, if I click on the other tabs it will go to control #3 then to the tab. In other words I have to double click the tabs in order to go to the other page.

How can I get it to recognize the tab click the first time and go to the other page without going to control #3 first?

Thanks for any help.
 
Try setting the tab order for each tab control. Then modify your "On Exit" event to tell it to go to the tab and control you want. Example:

Private Sub YourControlName_Exit(Cancel As Integer)
On Error GoTo YourControlName_Exit_Err

DoCmd.GoToControl "Page2" 'on exit of your control, go to page 2

YourControlName_Exit:

Exit Sub

YourControlName_Exit_Err:
MsgBox Error$
Resume YourControlName_Exit
End Sub

Hope this helps
 
bbeeching, thanks for your response. But perhaps I was not clear. I don't want to *always* go to the other tab from the control with the exit event, only when I click on it. (Also there are several different tabs) If I just tab or enter from the control with the exit event, I *do* want to stay on that page, but skip the next field and put the focus on the second field following on the same page (which was the purpose of the exit event).

Hope this is clearer.
 
Never mind, it did what I wanted when I deleted the exit event and set Tab Stop to No on the field I wanted to skip.
 
I've recently found that KeyPress or KeyDown work a WHOLE lot better than On Exit for tabbing out of a field. You avoid things like clicking away from the field triggering the event, and Ctrl-Tab works properly again.


[This message has been edited by David R (edited 05-01-2002).]
 

Users who are viewing this thread

Back
Top Bottom