I have a field for SSN that I would like a prompt to let the user know that hey haven't entered a SSN. This field isn't required, but can be very important. If I use validation text or requirements some users may get annoyed especially if they don't have the information. So, if the field is blank I like the box to let he user know it is blank and to click yes to continue or click no to enter a SSN. The prompt seems to be working, but if a user clicks "no" to go back and enter the SSN the cursor isn't going back to the field using set focus. I'm pretty sure the issue is in my statement.
Private Sub SSN_Exit(Cancel As Integer)
Dim strmsg As String
strmsg = "No SSN has been Entered. "
strmsg = strmsg & "Do you want to continue without entering a SSN? "
strmsg = strmsg & "Click Yes to Continue or No to enter a SSN. "
If IsNull(Me.SSN) Then
If MsgBox(strmsg, vgQuestion + vbYesNo, "Continue") = vbYes Then
'continue
Else
'DoNothing
End If
Else
Me.SSN.SetFocus
End If
End Sub
Private Sub SSN_Exit(Cancel As Integer)
Dim strmsg As String
strmsg = "No SSN has been Entered. "
strmsg = strmsg & "Do you want to continue without entering a SSN? "
strmsg = strmsg & "Click Yes to Continue or No to enter a SSN. "
If IsNull(Me.SSN) Then
If MsgBox(strmsg, vgQuestion + vbYesNo, "Continue") = vbYes Then
'continue
Else
'DoNothing
End If
Else
Me.SSN.SetFocus
End If
End Sub