date validation

student90210

New member
Local time
Today, 06:23
Joined
Apr 30, 2006
Messages
8
Basically i have a booking system and on certain days i need to allow an "extension", to do this i am using a yes/no and a check box. I need to creat a validation rule so that the box is only tickable if my Event_date field is a friday or saturday.

Do i need to use something like Weekday(Date()) = ?
 
You will have to use the AfterUpdate event for the Event Date text box.

if Weekday(me.[EventDate])>5 then
me.[ExtensionCheckBox].Enabled=true
Else
me.[ExtensionCheckBox].Enabled=False
End if
 
thanks, where it says me. am i supposed to put something relevant to my database in there, sorry i've never used visual basic before.
 
There is a module tied to every form you create. Me represents the form that is tied to the module you are writing code in.
 
I think its close to working, as in its in the right place with the right names, but now it comes back with Compile Error: External Name Not Defined. What does this mean?
Thanks
 
Can you post your code, I have never ran into this error before?
 
Private Sub Event_Date_AfterUpdate()
If Weekday(Module1.[Event Date]) > 5 Then
Module1.[Check21].Enabled = True
Else
Module1.[Check21].Enabled = False
End If

End Sub


thanks
 

Users who are viewing this thread

Back
Top Bottom