1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

limit fields to certain lengths....

Discussion in 'Business Applications' started by softspoken, Apr 20, 2010.

Thread Status:
Not open for further replies.
Advertisement
  1. softspoken

    softspoken Thread Starter

    Joined:
    Mar 22, 2010
    Messages:
    55
    How can you limit fields to certain lengths. For example I have a policy number field that is 10 characters long. I need for it to give an error message or something if they dont key in at least 10 numbers.

    Can anyone help?

    Thanks

    (Access 2003)
    [​IMG]
     
  2. OBP

    OBP

    Joined:
    Mar 8, 2005
    Messages:
    19,895
    You can place some simple VBA code in the After Update event of that field
    if len(me.policynumber) < 10 then
    msgbox "Must be 10 Characters in this field
    end if
    Make sure that where I have policynumber you have the correct name for that field.
     
  3. softspoken

    softspoken Thread Starter

    Joined:
    Mar 22, 2010
    Messages:
    55
    worked perfectly .... thank you very much...
     
  4. Keebellah

    Keebellah Trusted Advisor

    Joined:
    Mar 27, 2008
    Messages:
    6,608
    First Name:
    Hans
    Don't forget to mark this post solved
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Similar Threads - limit fields certain
  1. sardaukar
    Replies:
    6
    Views:
    980
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/918062

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice