Results 1 to 2 of 2
  1. #1
    djclntn is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2011
    Posts
    476

    Avoiding entering duplicate values

    The title of this thread is weak; I didn't know how to phrase it. I have this Form (or a Record) of Vehicles for sale which has a number of fields. Two fields ‘StockNumber’ & ‘VINNnumber are set as PK because I cannot have duplicates. The issue that I’m having is when I enter in a new Vehicles Info, if it (the vehicle) has already been entered it doesn’t tell me until I try to go to another (or New) Record. There must be a way (or is there a way) that when I enter in a New vehicle’s StockNumber as soon as I click to the next field if that particular StockNumber is already in the Table Access will tell me right away? Any suggestions will be greatly appreciated!

  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,529
    You can use a DCount() with the appropriate criteria to see if a duplicate exists already.

    DLookup Usage Samples
    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. Lookup values after entering data in form
    By Hulkdog in forum Forms
    Replies: 2
    Last Post: 01-23-2012, 12:31 PM
  2. Error on entering duplicate value
    By anwaar in forum Programming
    Replies: 3
    Last Post: 09-02-2011, 01:25 PM
  3. duplicate values
    By tarhim47 in forum Access
    Replies: 7
    Last Post: 05-03-2011, 11:30 AM
  4. Entering duplicate data in Form
    By cotri in forum Forms
    Replies: 1
    Last Post: 01-06-2010, 11:45 PM
  5. Duplicate Values in table
    By senthilrg in forum Queries
    Replies: 3
    Last Post: 12-18-2009, 09: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