I have a form that the user must enter in information in all the areas. I have it set up with the following on the first one.
Private Sub txtSerial1_Exit(Cancel As Integer)
If Len(Me.txtSerial1 & vbNullString) = 0 Then
MsgBox "Please enter a serial number"
Me.dteDate.SetFocus
Me.txtSerial1.SetFocus
Cancel = True
Exit Sub
End If
End Sub
is there a way i can put this as a function and call it when needed or do i need to put this if then in each EXIT? My issue is how i would do the setfocus.
Private Sub txtSerial1_Exit(Cancel As Integer)
If Len(Me.txtSerial1 & vbNullString) = 0 Then
MsgBox "Please enter a serial number"
Me.dteDate.SetFocus
Me.txtSerial1.SetFocus
Cancel = True
Exit Sub
End If
End Sub
is there a way i can put this as a function and call it when needed or do i need to put this if then in each EXIT? My issue is how i would do the setfocus.