Tabbed Forms

N

Nigel

I have a form with two tabs on it, both tabs getting its information from the
same query. When I tab through the first tabbed form and reach the last
control, and then tab again it goes to the next record on the first tabbed
form. Is there a way so that when I continue tabbing it will go to the first
control on the second tabbed form when I get to the last control on the first
form?

Thanks
 
S

Sandy Hayman

In the On Key Down event of the last control add the following code:

Private Sub LastControlName_KeyDown(KeyCode As Integer, Shift As Integer)

' Move the focus to the next tab in the tab control
If KeyCode = Asc(vbTab) Then SendKeys ("%n")

End Sub
 
N

Nigel

Hi Sandy

I entered the code in the location where you said but when I tab from the
last control, it goes to the next record rather than to the 2nd page of the
tabbed form.

What akm I doing wrong?

Thanks
 

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