L
Laura C.
Hi,
I've seen several useful for suggestions for how to get a field in a form to
be required based on the value in another field, but none of the code
provided is working for me. I think it may have something to do with the fact
that the "if" statement involves text -- I've been using the asterisk to
stand in for the rest of the string (i.e., only the first few words need to
be present to make the other field required). But do I want an "=" sign here,
or the expression "Is Like"?
I'm also wondering if part of the problem lies with the fact that the field
that I want to be required under certain conditions is a list box in which I
have generated the values from within the form (i.e., they are not being
called up from a table somewhere, also the values entered do GO INTO my
table).
Here is the code I've tried inserting under "BeforeUpdate" for the form:
If Me.Action = "Sales/purchases*" Then
If IsNull(Me.Event) = True Then
MsgBox "You must enter 'Purchase' or 'Redeem' under 'Event.'"
Cancel = True
End If
End If
What am I doing wrong?
I've seen several useful for suggestions for how to get a field in a form to
be required based on the value in another field, but none of the code
provided is working for me. I think it may have something to do with the fact
that the "if" statement involves text -- I've been using the asterisk to
stand in for the rest of the string (i.e., only the first few words need to
be present to make the other field required). But do I want an "=" sign here,
or the expression "Is Like"?
I'm also wondering if part of the problem lies with the fact that the field
that I want to be required under certain conditions is a list box in which I
have generated the values from within the form (i.e., they are not being
called up from a table somewhere, also the values entered do GO INTO my
table).
Here is the code I've tried inserting under "BeforeUpdate" for the form:
If Me.Action = "Sales/purchases*" Then
If IsNull(Me.Event) = True Then
MsgBox "You must enter 'Purchase' or 'Redeem' under 'Event.'"
Cancel = True
End If
End If
What am I doing wrong?