Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2010

    Unanswered: Checking for duplicates using the Next Record button

    Hi all,

    Another (hopefully simple) Access question from me.

    Each of my forms are set up in the following format:
    Form Fields (Name, etc)
    Navigation buttons (First, Previous, Next, and Last)
    Record buttons (Add, Update, and Delete)

    I figured out how to display an error message to the user when entering a duplicate and clicking on the Add button by Exporting the Macros to VB, and by adding a DLookup. However, the Next button will allow for the record to be added as well (which I didn't know). Is there anyway to prevent the Next button from adding a duplicate record within the table? The only way I have found so far is by making the field indexed. This is fine except I can't display a nice error message to the user.

    Any ideas?


  2. #2
    Join Date
    Oct 2009
    depending on the DLookup result you can turn off the form's ability to make additions:

    me.AllowAdditions = False

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts