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

SetFocus

Status
Not open for further replies.

jminn0311

Technical User
Jan 7, 2004
66
US
How do you set the focus to a field in a subform in the after update event of a field on the mainform. It's got me bamboozeled.

THanks,
Jeff M.
 
Try this:

Private Sub MainField_AfterUpdate()
Forms![frmMain]![subMain].SetFocus
Forms![frmMain]![subMain]![subField].SetFocus
End Sub
 
If sfreeman's suggestion doesn't work, you may try something like this:
Private Sub MainField_AfterUpdate()
Forms![frmMain]![subMain].SetFocus
Forms![frmMain]![subMain].Form![subField].SetFocus
End Sub

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top