T
Tal
So, I have a big long function that validates all the data on an entry form.
However, I don't know how to put a Else that skips to the next line instead
of returning true. This only effects that last two items in my code. See
below.
Basically, the function works unless you haven't marked it as paid AND if
the donation is over $1000.00. Cause once you answer the paid/unpaid problem,
it marks it as True and skips the "Over $1000.00" issue.
Is there something I can put in there that validates the payment issue and
then continues on to the amount.
Many thanks in advance for all your help!!
Cheers,
Tal
Private Function fnValidateEntry() As Boolean
fnValidateEntry = False
If IsNull(Me.cboSelectDonor) Then
If MsgBox("You must select a donor. Click OK to complete the entry.
Click Cancel to continue without saving the record.", vbOKCancel, "Missing
Information") = vbOK Then
fnValidateEntry = False
Me.cboSelectDonor.SetFocus
Else
If Me.Dirty Then
Me.Undo
End If
End If
ElseIf IsNull(Me.cboDonorAddress) Then
If MsgBox("You must select a donor address. Click OK to complete the
entry. Click Cancel to continue without saving the record.", vbOKCancel,
"Missing Information") = vbOK Then
fnValidateEntry = False
Me.cboDonorAddress.SetFocus
Else
If Me.Dirty Then
Me.Undo
End If
End If
ElseIf IsNull(Me.dtDonationPaymentDate) Then
If MsgBox("Did you intend to mark this donation as paid. Click Yes to
return to the record. Click No to leave the donation unpaid.", vbYesNo,
"Payment Information") = vbYes Then
fnValidateEntry = False
Me.ynDonationPaid.SetFocus
Else
fnValidateEntry = True
End If
ElseIf Me.curDonationAmount >= 1000 Then
If MsgBox("This donation requires follow-up. Does it require any special
action? Click Yes to return to the record and enter the special actions in
the Comment field. Or click No to continue. A letter will be sent by
default.", vbYesNo, "Follow Up Required") = vbYes Then
fnValidateEntry = False
Me.memDonationComment.SetFocus
Else
fnValidateEntry = True
End If
Else
fnValidateEntry = True
End If
End Function
However, I don't know how to put a Else that skips to the next line instead
of returning true. This only effects that last two items in my code. See
below.
Basically, the function works unless you haven't marked it as paid AND if
the donation is over $1000.00. Cause once you answer the paid/unpaid problem,
it marks it as True and skips the "Over $1000.00" issue.
Is there something I can put in there that validates the payment issue and
then continues on to the amount.
Many thanks in advance for all your help!!
Cheers,
Tal
Private Function fnValidateEntry() As Boolean
fnValidateEntry = False
If IsNull(Me.cboSelectDonor) Then
If MsgBox("You must select a donor. Click OK to complete the entry.
Click Cancel to continue without saving the record.", vbOKCancel, "Missing
Information") = vbOK Then
fnValidateEntry = False
Me.cboSelectDonor.SetFocus
Else
If Me.Dirty Then
Me.Undo
End If
End If
ElseIf IsNull(Me.cboDonorAddress) Then
If MsgBox("You must select a donor address. Click OK to complete the
entry. Click Cancel to continue without saving the record.", vbOKCancel,
"Missing Information") = vbOK Then
fnValidateEntry = False
Me.cboDonorAddress.SetFocus
Else
If Me.Dirty Then
Me.Undo
End If
End If
ElseIf IsNull(Me.dtDonationPaymentDate) Then
If MsgBox("Did you intend to mark this donation as paid. Click Yes to
return to the record. Click No to leave the donation unpaid.", vbYesNo,
"Payment Information") = vbYes Then
fnValidateEntry = False
Me.ynDonationPaid.SetFocus
Else
fnValidateEntry = True
End If
ElseIf Me.curDonationAmount >= 1000 Then
If MsgBox("This donation requires follow-up. Does it require any special
action? Click Yes to return to the record and enter the special actions in
the Comment field. Or click No to continue. A letter will be sent by
default.", vbYesNo, "Follow Up Required") = vbYes Then
fnValidateEntry = False
Me.memDonationComment.SetFocus
Else
fnValidateEntry = True
End If
Else
fnValidateEntry = True
End If
End Function