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

Setfocus from one subform to another

Status
Not open for further replies.

zrobinso

MIS
Apr 22, 2001
27
0
0
US
We have a form to track services provided. The goal is to have the focus sent from one sub form to another if certain entries are choosen from a combo field. The code we are using is below. We are able to receive the info message, but the focus remains on the combo box.

If this is not possible, can someone give me any ideas on validating a subform when main form closes.

Private Sub Service_Result_Desc_AfterUpdate()
If Me.Service_Result_Desc = "ID Job Vacancies" Then
MsgBox "ID Job Vacancies was selected. You must enter an OES Information.", vbInformation
[Forms]![frm_Services2]![frm_ServicesNewOES]![OES_Code].SetFocus
ElseIf Me.Service_Result_Desc = "Consumer Hired" Then
MsgBox "Consumer Hired was selected. You must enter Client Information.", vbInformation
[Forms]![frm_Services2]![frm_ClientInfo]![ClientID].SetFocus
End If
End Sub

Thanks,
Z
 
You might try setting focus to a field with in the subform. Something like this:

[Forms]![frm_Services2]![frm_ServicesNewOES]![OES_Code].form!Field1.SetFocus
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top