V
vmf
I am using the following code in my form but it isn't producing a message box
when tabbing to a new record. I think the problem might be with the "And"
but I'm not sure. Any help would be appreciated.
Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim strMsg As String
If Me.Combo36 = "P" And IsNull(Me.BegSeqNum) Then
Cancel = True
strMsg = strMsg & "Beginning Sequence Number required." & vbCrLf
End If
If Me.BegSeqNum > 0 And IsNull(Me.EndSeqNum) Then
Cancel = True
strMsg = strMsg & "End Sequence Number required." & vbCrLf
End If
If Cancel Then
strMsg = strMsg & "Correct the entry, or press Esc to undo."
MsgBox strMsg, vbExclamation, "Invalid data"
End If
End Sub
when tabbing to a new record. I think the problem might be with the "And"
but I'm not sure. Any help would be appreciated.
Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim strMsg As String
If Me.Combo36 = "P" And IsNull(Me.BegSeqNum) Then
Cancel = True
strMsg = strMsg & "Beginning Sequence Number required." & vbCrLf
End If
If Me.BegSeqNum > 0 And IsNull(Me.EndSeqNum) Then
Cancel = True
strMsg = strMsg & "End Sequence Number required." & vbCrLf
End If
If Cancel Then
strMsg = strMsg & "Correct the entry, or press Esc to undo."
MsgBox strMsg, vbExclamation, "Invalid data"
End If
End Sub