update date field base on a dropdown

  • Thread starter Thread starter Jessica
  • Start date Start date
J

Jessica

I need the date field to require a date if yes is selected from a dropdown. I
have the below fields

IE (yes or no drowpdown)
Date of Last IEP (date field)
 
Jessica -

Assuming this is a form with the two fields mentioned, I would suggest
putting your validation code on the BeforeUpdate event, and if the IE is No,
and there is no date, then you can Cancel the event and show an error
message.

Your code in the BeforeUpdate event would be something like this:

If Me.IE = "Yes" Then ' Assuming text if you are using a drop-down instead
of a checkbox
If isnull(Me.LastIEPDate) Then
Cancel = True
msgbox ("If IE is Yes, then you must enter a date")
End If
End If

Hope that is what you are asking for.
 
Back
Top