J
JOM
I have a the following event procedure in the form's before update. the
problem is that it if everything is filled out right the msgbox keeps popping
up all the time but it does not indicate what is incomplete, but on the other
had if something is incomplete, it will say what it is but still have the
popup again, any reason why?
Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim strControl As String
If Me.Request = True And IsNull(Me.reason) Then
strControl = strControl & "Reasons " & vbCrLf
Me.reason.SetFocus
End If
If IsNull(Me.DateRequested) Then
strControl = strControl & "Date Requested" & vbCrLf
Me.DateRequested.SetFocus
End If
MsgBox "The following information is required:" & vbCrLf & strControl,
vbInformation, "Incomplete Information"
Cancel = True
Exit Sub
End Sub
problem is that it if everything is filled out right the msgbox keeps popping
up all the time but it does not indicate what is incomplete, but on the other
had if something is incomplete, it will say what it is but still have the
popup again, any reason why?
Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim strControl As String
If Me.Request = True And IsNull(Me.reason) Then
strControl = strControl & "Reasons " & vbCrLf
Me.reason.SetFocus
End If
If IsNull(Me.DateRequested) Then
strControl = strControl & "Date Requested" & vbCrLf
Me.DateRequested.SetFocus
End If
MsgBox "The following information is required:" & vbCrLf & strControl,
vbInformation, "Incomplete Information"
Cancel = True
Exit Sub
End Sub