Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2004
    Posts
    48

    Required fields in Access database

    In a previously designed database, I made fields required by setting the Validation Rule to the [first name] field to Is not null and the Validation Text to "Please enter a first name." I didn't want to use Required = Yes because it gives the user a message that is too technical. This method worked just fine. When the user clicked on the command button to close the form, the above messages would pop up if the field was left blank.

    I've tried the same method in a database currently being designed and it's not working. Nothing happens when the user clicks on the close button.

    I don't know if this makes a difference but in the first database, the field requirements were on a subform. In the second, the requirements are on a main form not connected to anything else. Also, the first database was done using Access 2000 and the second, Access 2003.

    Does anyone have any suggestions as to why this isn't working or suggest an alternate way of making the fields required?

    Thanks in advance for any help.

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,092
    When the record saves without failing validation; is the value saved a blank string, or is it a NULL value?

    I'm betting it's the former.
    George
    Home | Blog

  3. #3
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    12,433
    could be

    another possible cause of problems is applying such rules inthe db, after the form is created... often the form designer doesn't pull these changed values into the form.
    I'd rather be riding on the Tiger 800 or the Norton

  4. #4
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    The process should be identical.

    Nothing happens when the user clicks on the close button.
    Can you confirm the code is actually running?
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

Posting Permissions

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