If condition

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.
 
L

Luiz Cláudio

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
 
Top