Results 1 to 4 of 4
  1. #1
    Amber's Avatar
    Amber is offline Novice
    Windows XP Access 2007
    Join Date
    Jan 2012
    Posts
    8

    Change error message for dupicate entry

    Hi all,

    Is there a way to change the pop up message for someone trying to enter duplicate information? Right now it a long message that is not very easy to understand for non Access users.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    What information are they entering?

    Deal with the user input before Access does. Use BeforeUpdate event with code to check database for possible duplicate and if found cancel the user entry, give them a message 'already in database' and return them to the form.

    Another approach is to give users valid choices from combobox list.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Amber's Avatar
    Amber is offline Novice
    Windows XP Access 2007
    Join Date
    Jan 2012
    Posts
    8
    The information would be invoice number (we obviously don't want that to duplicate ). I have an embedded Macro setup on "Before Update". Action is "MsgBox" with an argument message "Error duplicate invoice number". But this message is popping up on every invoice number regardless if it's a duplicate. Not sure what I'm doing wrong....

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    I don't use embedded macros, only vba.

    The macro doesn't include code to search for the duplicate and also need an If Then conditional statement. In VBA, something like:

    If Not IsNull(DLookup("SerialNumber", "tablename", "SerialNumer='" & Forms!formname!textboxname & "'")) Then
    MsgBox "already in database"
    Cancel = True
    End If

    Could attach project for analysis.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 4
    Last Post: 01-14-2016, 02:18 PM
  2. Copying entry form, change control source
    By Bdowns in forum Access
    Replies: 11
    Last Post: 02-06-2012, 05:39 PM
  3. Error Message
    By Juan4412 in forum Forms
    Replies: 5
    Last Post: 03-06-2011, 04:22 PM
  4. Error Message re: data entry of date
    By Pro-not in forum Access
    Replies: 9
    Last Post: 10-22-2010, 10:14 AM
  5. If / Then Error Message
    By Schwagr in forum Forms
    Replies: 4
    Last Post: 03-30-2006, 06:28 AM

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