Results 1 to 3 of 3
  1. #1
    aligahk06 is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Posts
    94

    Validating field value


    Dear All,

    i want to validate control value in a form.
    Supposing i have already entered records correspond to unique no for eg 4213.
    if i again enter the same unique no for eg 4213 for field control prCol1 then it validate number already exist.Please check
    table name woPR ,field name prCol1

    Please assist?

    rgds,
    aligahk06

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,530
    Quote Originally Posted by aligahk06 View Post
    Dear All,

    i want to validate control value in a form.
    Supposing i have already entered records correspond to unique no for eg 4213.
    if i again enter the same unique no for eg 4213 for field control prCol1 then it validate number already exist.Please check
    table name woPR ,field name prCol1

    Please assist?

    rgds,
    aligahk06
    Might be best to post a copy of the db again with instructions on how to replicate your problem
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,389
    Couple of ways to handle this.
    1. Easiest, make prCol1 primary key in the table. This will give you a not very friendly Microsoft message about a duplicate.
    2. In the after_update event of the PR# textbox, do a dLookup or DCount to see if the number already exists. Then you can supply your own message box and undo the user input.

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

Similar Threads

  1. Validating table field value in MS Access
    By aligahk06 in forum Access
    Replies: 4
    Last Post: 08-18-2020, 03:08 AM
  2. Replies: 4
    Last Post: 10-17-2019, 06:19 PM
  3. Replies: 2
    Last Post: 07-31-2016, 03:50 PM
  4. Replies: 4
    Last Post: 06-21-2016, 11:49 AM
  5. Validating Field Data Across Tables?
    By venomshot in forum Forms
    Replies: 4
    Last Post: 02-04-2010, 05:04 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