View Full Version : validating a date


tombutcher1990
11-28-2010, 04:31 AM
Hi All,

i've been googling for a bit but don't think that i know what to search or how to word it properly. i'm ok with access but by no means a genius at it.

basically, i'm using the built in template from Access 2007 for the Student Details. i run a club and we are using this as our register etc.

i want to modify it slightly, as we use a ban system for punishment. what this means is that really when they sign in at the start of the evening, if they have been told they are banned for that date, then it will pop up and warn me of this. what i've got so far is the attendance table which stores who attends on what dates, and a "banned list" table which stores their name and the date for which they are banned. what i need to know is how i get the form where i input the data to alert me if we have entered that they are banned on this date, and i believe that i do this through a validation rule.

so, i hope this make sense, and that someone could help point me in the right direction!!

Thanks

RuralGuy
11-28-2010, 06:34 AM
Actually you are probably going to want to use code in the form where you enter the data.

tombutcher1990
11-28-2010, 07:07 AM
do you mean like VB or something?

RuralGuy
11-28-2010, 07:12 AM
Yes, but Access supports VBA which is slightly different than VB. Have you ever worked with Object Oriented - Event Driven Software?

tombutcher1990
11-28-2010, 07:17 AM
uhh, i did some work on it in college, but i'm certainly not an expert. i have a basic understanding of how it works and how to write it. are you able to point me in the right direction?

Thanks

RuralGuy
11-28-2010, 07:24 AM
You could use DLookup() or DCount() in the BeforeUpdate event of the control where you are entering the name (probably a ComboBox to minimize errors). Here's how to use them: http://www.mvps.org/access/general/gen0018.htm and help *should* be of further assistance although ac2007 help leaves a little to be desired.

tombutcher1990
11-28-2010, 07:29 AM
excellent thanks very much, i'll take a look and see how i get on :)

RuralGuy
11-28-2010, 07:34 AM
We'll be around to assist if you get stuck.