Log in

View Full Version : [SOLVED:] Validation Rule question



werafa
05-19-2017, 05:40 AM
Hi all,

I'm trying to set a validation rule on a month name field.
I've set the default value to =MonthName(DatePart("m",Now()))
I've created a table with the month names that I wish to allow the user to select

I can't figure out how to create the validation rule

my lookup table is _Months, and the relevant field is _MonthName
my Validation table is Data, and the validated field is _Month

Can anyone tell me where to find out how to do this?
thanks
Werafa

werafa
05-19-2017, 06:18 AM
hmm, should I attempt to do this in a user-form?
This is for the main data entry table

thanks
Werafa

OBP
05-20-2017, 03:24 AM
As a general rule the user should never interact directly with the Table and a form should be used for data input.
So any Validation and Filtering should be carried out on the Form.
If you are frorcing the User to select the Current month by using Now() then you could dispense with them entering the data at all and use either a default or VBA to make the entry for them.

werafa
05-20-2017, 01:47 PM
thanks.

I've got the default value coming from now() = but it is conceivable that the the data will be entered post-fact. but I've done this in the table,

I appreciate the guidance - I'm a novice with Access
Werafa

OBP
05-21-2017, 12:55 AM
So, have you got it working on the form now?

werafa
05-21-2017, 03:03 AM
I have. It took a bit to figure out the two columns of data (the ID and the lookup value) and the fact that you record the id, but hide it in the lookup column widths - but have got it working, and I think I understand how I got it working.

Thanks for your help