Results 1 to 5 of 5
  1. #1
    AccessPoint is offline Novice
    Windows XP Access 2002
    Join Date
    Jul 2010
    Posts
    4

    Red face Checking user input is valid

    I am posting today because I need some help to check user input is valid.

    I have a field with 11 characters.

    Characters 1-3 must be either 'OLD' or 'NEW'
    Character 4 must be a double-colon
    Characters 5-7 can be any number between 000 and 999
    Character 8 must be a dash
    Characters 9-11 can be any number between 000 and 999

    I have tried to use an input mask but as far as I know it can only check if a character it a letter or number

    To complicate matters further the user will be entering data in a form using datasheet view and all 11 characters must be entered\stored in one field.



    Any help would be appreciated, Thank you.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Offhand I can't think of a validation rule or input mask that could do it all. I'd use the before update event of the form (you could also use the before update event of the textbox):

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

    You can capture each portion of the input for testing with the Mid() function.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    AccessPoint is offline Novice
    Windows XP Access 2002
    Join Date
    Jul 2010
    Posts
    4

    Thank you

    Thank you for taking the time to answer my query.

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    AccessPoint,
    Are you ready to follow the link in my sig and mark this thread as Solved?

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Quote Originally Posted by AccessPoint View Post
    Thank you for taking the time to answer my query.
    No problemo, and welcome to the site by the way!
    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: 3
    Last Post: 08-25-2010, 09:03 AM
  2. Replies: 0
    Last Post: 03-22-2010, 07:51 PM
  3. User Input Query
    By ManC in forum Queries
    Replies: 2
    Last Post: 03-04-2010, 07:09 PM
  4. Chart with user input
    By mungyun in forum Access
    Replies: 1
    Last Post: 12-28-2009, 07:44 PM
  5. Set required user input
    By ZeusOsiris in forum Database Design
    Replies: 2
    Last Post: 12-04-2006, 07:13 PM

Tags for this Thread

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