Dear Access expert.
When I use the Validation Rule Property
<>0 Or Not Is Null
Nothing is triggered if the user doesn't type anything.
So I tried code.
On exit AND lost focus events of the control, I trigger the below code. The code works except for the SetFocus line. Unfortunately the focus doesn't return to the control.
Thanks for your help.
When I use the Validation Rule Property
<>0 Or Not Is Null
Nothing is triggered if the user doesn't type anything.
So I tried code.
On exit AND lost focus events of the control, I trigger the below code. The code works except for the SetFocus line. Unfortunately the focus doesn't return to the control.
Code:
Private Sub cboGeneratorNumber_LostFocus()
If Me.cboGeneratorNumber = 0 Or IsNull(Me.cboGeneratorNumber) Then
MsgBox "You must select a Generator.", , appTitle
Me.cboGeneratorNumber.SetFocus
End If
End Sub
Thanks for your help.