Consulting

Results 1 to 6 of 6

Thread: Validation Rule question

  1. #1
    VBAX Mentor
    Joined
    Aug 2012
    Posts
    367
    Location

    Validation Rule question

    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
    Remember: it is the second mouse that gets the cheese.....

  2. #2
    VBAX Mentor
    Joined
    Aug 2012
    Posts
    367
    Location
    hmm, should I attempt to do this in a user-form?
    This is for the main data entry table

    thanks
    Werafa
    Remember: it is the second mouse that gets the cheese.....

  3. #3
    VBAX Guru
    Joined
    Mar 2005
    Posts
    3,296
    Location
    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.

  4. #4
    VBAX Mentor
    Joined
    Aug 2012
    Posts
    367
    Location
    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
    Remember: it is the second mouse that gets the cheese.....

  5. #5
    VBAX Guru
    Joined
    Mar 2005
    Posts
    3,296
    Location
    So, have you got it working on the form now?

  6. #6
    VBAX Mentor
    Joined
    Aug 2012
    Posts
    367
    Location
    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
    Remember: it is the second mouse that gets the cheese.....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •