The Control Source is JobID, the name is txtJobID, it is a combobox on a continuous form on a subform and the user skips over the job number selection and continues. Before the record is saved the before update event kicks in correctly and requests that a job number is selected. That part works, but I would like the focus to go back to the combobox.
No matter what I try the setfocus comes back with an error message. http://www.mvps.org/access/forms/frm0031.htm
The accessweb shows that if you are on sub1 refering to sub1 one should be able to use Me!ControlName.Enabled
My first try in the code below was Me![txtJobID].setfocus
Here is rest of my code, I am on the subform:
Private Sub Form_BeforeUpdate(Cancel As Integer)
''the main form is [FrmHoursInput]
''this is on subform [FrmHoursInputSub]
If IsNull(txtJobID) Then
Me![FrmHoursInputSub].Form![txtJobID].SetFocus
Cancel = True
MsgBox "Go back to JobNo Field and enter a Job Number"
End If
End Sub