Results 1 to 2 of 2
  1. #1
    dyhunter is offline Novice
    Windows Vista Access 2007
    Join Date
    May 2014
    Posts
    9

    Question Validation of inputed data

    I have been searching, and have found inforation that tells me I have to use a validation after update (or possibly before update), but does not tell me how. I have a database that I record someinforation on parts. I have 4 different syles of part numbers, and want to try and catch incorrect entries (extra or missing digits, incorrect characters, etc). For example:



    123456 - 6 digits, all numbers
    L12345 - 6 digits, first one a letter
    123-45678 - 8 digits all numbers with a hyphen after the third
    12345678 - 8 digtis all numbers no hyphen and the first digit always the same number

    How do I get Access to test my input and if it does not meet one of the above examples to not accept.

  2. #2
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    Here is the code method basics:

    http://www.baldyweb.com/BeforeUpdate.htm

    functions that may come in handy include Len, IsNumeric, Left and InStr.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 14
    Last Post: 01-07-2014, 04:20 PM
  2. Data Validation
    By Traci in forum Programming
    Replies: 1
    Last Post: 08-21-2012, 10:59 AM
  3. Data Validation using VBA
    By Cheshire101 in forum Programming
    Replies: 3
    Last Post: 05-10-2011, 08:43 AM
  4. Data Validation of another field
    By dssrun in forum Access
    Replies: 4
    Last Post: 03-22-2011, 01:09 PM
  5. Data Validation - Please help
    By larry S in forum Access
    Replies: 0
    Last Post: 11-16-2008, 10:24 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums