S
Stephanie
Allen et al,
I'm still having problems with the routine to gather my
required fields into one msg box.
I enter a name and save, skipping all required fields. I
get the first prompt (select member/read). When I click
OK, I get the dreaded "DoMenuItem action was cancelled".
I click OK and then select member/read and click save.
Then a msg box pops up to tell me that I'm missing 3
other required fields (nifty!). I click OK. Then I
immediately get the dreaded "No current record" msg box.
So I populate some of the required fields (you know
users!). I get the appropriate combined required fields
prompt. When I click OK I get "DoMenuItem action was
cancelled". Am I doing something wrong? I've attached
the code here, with my conditionals. Thanks for the
help, Stephanie
Private Sub Form_BeforeUpdate(Cancel As Integer)
'On Error GoTo Err_Form_BeforeUpdate
Dim bWarn As Boolean 'Flag to warn user.
Dim strMsg As String 'MsgBox message.
'**************************************
'Handle required fields.
'**************************************
If (Me!Option1) = 0 And (Me!Option2) = 0 Then
Cancel = True
strMsg = strMsg & "Please select either 'ITA
Member' or 'R.E.A.D. Team '" & vbCrLf
End If
If IsNull(Me!MemberDateName) And ((Option1) = -1 Or
(Option2) = -1) Then
Cancel = True
strMsg = strMsg & "Please enter an 'Associated
Since' Date." & vbCrLf
End If
If ((Option1) = -1 Or (Option2) = -1) And ((Me!
MemberStatusName) = 0 Or (Me!MemberTypeName) = 0) Then
Cancel = True
strMsg = strMsg & "Please enter Member 'Status'
and 'Type'." & vbCrLf
End If
If ((Option1) = -1 Or (Option2) = -1) And IsNull(Me!
StateOrProvinceName) Then
Cancel = True
strMsg = strMsg & "Please enter the 2
letter 'State' code to continue." & vbCrLf
End If
'Concatenate other messages the same way.
'NOT USING WARNING (YET)
' If Not Cancel Then
' '**************************************
' 'Warning fields
' '**************************************
' If Me.BirthDate > Date Then
' bWarn = True
' strMsg = strMsg & "Born in the future?" &
vbCrLf
' End If
' 'etc for other warnings.
' End If
'Response
Call CancelOrWarn(Cancel, bWarn, strMsg)
End Sub
I'm still having problems with the routine to gather my
required fields into one msg box.
I enter a name and save, skipping all required fields. I
get the first prompt (select member/read). When I click
OK, I get the dreaded "DoMenuItem action was cancelled".
I click OK and then select member/read and click save.
Then a msg box pops up to tell me that I'm missing 3
other required fields (nifty!). I click OK. Then I
immediately get the dreaded "No current record" msg box.
So I populate some of the required fields (you know
users!). I get the appropriate combined required fields
prompt. When I click OK I get "DoMenuItem action was
cancelled". Am I doing something wrong? I've attached
the code here, with my conditionals. Thanks for the
help, Stephanie
Private Sub Form_BeforeUpdate(Cancel As Integer)
'On Error GoTo Err_Form_BeforeUpdate
Dim bWarn As Boolean 'Flag to warn user.
Dim strMsg As String 'MsgBox message.
'**************************************
'Handle required fields.
'**************************************
If (Me!Option1) = 0 And (Me!Option2) = 0 Then
Cancel = True
strMsg = strMsg & "Please select either 'ITA
Member' or 'R.E.A.D. Team '" & vbCrLf
End If
If IsNull(Me!MemberDateName) And ((Option1) = -1 Or
(Option2) = -1) Then
Cancel = True
strMsg = strMsg & "Please enter an 'Associated
Since' Date." & vbCrLf
End If
If ((Option1) = -1 Or (Option2) = -1) And ((Me!
MemberStatusName) = 0 Or (Me!MemberTypeName) = 0) Then
Cancel = True
strMsg = strMsg & "Please enter Member 'Status'
and 'Type'." & vbCrLf
End If
If ((Option1) = -1 Or (Option2) = -1) And IsNull(Me!
StateOrProvinceName) Then
Cancel = True
strMsg = strMsg & "Please enter the 2
letter 'State' code to continue." & vbCrLf
End If
'Concatenate other messages the same way.
'NOT USING WARNING (YET)
' If Not Cancel Then
' '**************************************
' 'Warning fields
' '**************************************
' If Me.BirthDate > Date Then
' bWarn = True
' strMsg = strMsg & "Born in the future?" &
vbCrLf
' End If
' 'etc for other warnings.
' End If
'Response
Call CancelOrWarn(Cancel, bWarn, strMsg)
End Sub