If condition

  • Thread starter Thread starter nl
  • Start date Start date
N

nl

How can I set up a field in a table or form, for example,
If the entry it's goin to be: If day of week is
Wednesday, and hours are 9 or 10 AM, then don't accept
entry.

Thank you.
 
You can use BeforeUpdate event:

If Isdate(Me.YourControl) Then
If Weekday(Me.YourControl) = vbWednesday Then
Cancel=True
MsgBox "Invalid date"
End if
End if

Luiz Cláudio C. V. Rocha
São Paulo - Brazil
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top