PDA

View Full Version : I'm trying to write a validation rule to a drop down menu..is this possible?



wedd
09-21-2010, 05:32 AM
I was wondering if it was possible to write a validation rule on a drop down list that when a start and end times are simultaneous are set another user isn't able to set the same times because an error message occurs...unless the initial times has been cancelled. Is this possible to do? If its not possible to implement as a validation rule or macro is there an alternative way to do this? Thanks for your solutions :bow:

SoftwareMatt
09-21-2010, 09:19 AM
Are you ayin you have a start and end time drop-down and if the user selects the same time you need an error?

If so I woiuld do this in VBA on the afterupdate of the drop-down boxes. Something like this:

Afterupdate of combo1
If me!combo1 = me!combo2 then
msgbox "ERROR: This is the same time!!"
me!combo1 = null
end if

Afterupdate of combo2
If me!combo2 = me!combo1 then
msgbox "ERROR: This is the same time!!"
me!combo2 = null
end if

wedd
09-21-2010, 10:00 AM
Thats right!

wedd
09-21-2010, 10:12 AM
for example is a user booked a session at 5 - 6 on tuesday 21 september, i want to prevent a user booking a customer at the same time...for a session