T
Tony Williams
PC Datasheet helped me with some code some days ago for which I'm very
grateful. I wanted a message to appear if the user didn't enter data into a
control on a form. Here is the code
Dim MsgStr As String
Dim TitleStr As String
MsgStr = "You can not enter a record without " _
& "completing the Qtr End Date" & vbCrLf & vbCrLf _
& "Do You Wish To Go Back " _
& "And Enter The Qtr End Date?"
TitleStr = "Qtr End Date Must Be Entered"
If IsNull(Me!txtMontha) Or Me!txtMontha = "" Then
If MsgBox(MsgStr, vbYesNo, TitleStr) = vbYes Then
Cancel = True
Me.txtMontha.SetFocus
Else
Me.Undo
End If
End If
The message appears just fine but I can't get the cursor to go back to the
control txtMontha it always goes to the next control on the form.
Can anyone help?
Thanks
Tony
grateful. I wanted a message to appear if the user didn't enter data into a
control on a form. Here is the code
Dim MsgStr As String
Dim TitleStr As String
MsgStr = "You can not enter a record without " _
& "completing the Qtr End Date" & vbCrLf & vbCrLf _
& "Do You Wish To Go Back " _
& "And Enter The Qtr End Date?"
TitleStr = "Qtr End Date Must Be Entered"
If IsNull(Me!txtMontha) Or Me!txtMontha = "" Then
If MsgBox(MsgStr, vbYesNo, TitleStr) = vbYes Then
Cancel = True
Me.txtMontha.SetFocus
Else
Me.Undo
End If
End If
The message appears just fine but I can't get the cursor to go back to the
control txtMontha it always goes to the next control on the form.
Can anyone help?
Thanks
Tony