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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I want to move from one subform to another subform on a mainform 1

Status
Not open for further replies.

seawave

Technical User
Oct 21, 2002
30
US
I have 2 subforms on a mainform. When the user completes the entry on one of the subforms I want the focus to go to the first field in the next subform.
I have an AddNew command button on the 1st subform to save the data to the appropriate table. After the record is saved and the form textboxes are set to null, I would like for the user to start data entry on the 2nd subform (at the first textbox on the 2nd subform). Can code be added to the AddNew button on the 1st subform to set the focus to the 2nd form.
EX: After the user enters the last textbox value on the 1st subform's textbox named POS. I want the record saved and then I want the user to begin entering data on the first textbox (named WA) of the 2nd subform.
Any help is appreciate.
Thank you.
 
To set focus to the 2nd subform, try this:

forms!YourMainForm!2ndSubformControlName.form!WA.SetFoucs
 
Thanks FancyPrairie,
I will try this. Can I add this code in with my code on the AddNew command button on the 1st subform?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top