Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Forms, Subforms, Tabing from Form to Subform 1

Status
Not open for further replies.

mrfilez

Technical User
Apr 10, 2001
50
US
I have a Form(frmName). This form has 3 subforms. subfrmSeat, subfrmComp, subfrmProb

subfrmSeat has 2 fields (podnum, posnum)
subfrmComp has 2 fields (sernum, modnum)
subfrmProb has 11 fields unless you want to know them I wont type them :)

I can tab through the fields in frmName and into subfrmSeat.
When I try to leave subfrmSeat and tab to subfrmComp, the cursor just flips back and forth between podnum and posnum. Is there a way to fix it so that you can tab through all the fields in the form and sub forms?

Thanks,
Don
 
Try the following codes:

Sub LastControlInSubfrmSeat_lostfocus()

me.parent.form!SubfrmComp.form!firstControlInSubfrmComp.setfocus

End sub

Seaport
 
Thank you for your time and help Seaport. Unfortunately, I tried it, but I could not get it to work. :-( This is what I did:

Private Sub ModNum_LostFocus()

Me.Parent.Form!subfrmSeat.Form!txtPodNum.SetFocus

End Sub

This did not seem to change anything.
 
OK, I think we went too fast. We have to set the focus on the subform first.

Try the following codes.

Private Sub ModNum_LostFocus()

Me.Parent.Form!subfrmSeat.SetFocus
Me.Parent.Form!subfrmSeat.Form!txtPodNum.SetFocus

End Sub

This should work.

Seaport
 
That did it! Thanks! I probably should have mentioned that I am really new to Access, sorry about that.

Thanks,
Don
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top