Results 1 to 3 of 3
  1. #1
    uronmapu is offline Competent Performer
    Windows XP Access 2007
    Join Date
    May 2012
    Posts
    124

    How to Prevent Duplicate mobile from being entered into table ...

    I have a tblContacts table including the fields: ID, Full Name, Mobile (format text)

    And a NewContact form including the textboxs: ID, Full Name, Mobile

    How to Prevent Duplicate mobile from being entered into NewContacts form ...

    I'm using the code below:

    Code:
    DLookUp("[Mobile]","tblContacts","[Mobile] = '" &  [Forms]![NewContact]![Mobile] & "' and [CustID] <>" &  [Forms]![NewContact]![ID]) Is Null
    but have error message:






    Or: (but error the sames)

    1. In the Navigation Pane, right-click the table that contains the field, and then click Design View.
    2. Select the field that you want to make sure has unique values.
    3. In the Field Properties pane, on the General tab, set the Indexed property to Yes (No duplicates).




    Many thanks,

  2. #2
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    Quote Originally Posted by uronmapu View Post
    I have a tblContacts table including the fields: ID, Full Name, Mobile (format text)

    And a NewContact form including the textboxs: ID, Full Name, Mobile

    How to Prevent Duplicate mobile from being entered into NewContacts form ...

    I'm using the code below:

    Code:
    DLookUp("[Mobile]","tblContacts","[Mobile] = '" &  [Forms]![NewContact]![Mobile] & "' and [CustID] <>" &  [Forms]![NewContact]![ID]) Is Null
    but have error message:



    Remove the " from the validation rule
    Or: (but error the sames)

    1. In the Navigation Pane, right-click the table that contains the field, and then click Design View.
    2. Select the field that you want to make sure has unique values.
    3. In the Field Properties pane, on the General tab, set the Indexed property to Yes (No duplicates).




    Many thanks,
    Show us the details for the field MOBILE - that's what has to have no duplicates.

  3. #3
    uronmapu is offline Competent Performer
    Windows XP Access 2007
    Join Date
    May 2012
    Posts
    124
    Done

    Code:

    Code:
    DLookUp("[Mobile]","tblNames","[Mobile] = '" & [Forms]![frmNewContact]![text4] & "'") Is Null

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

Similar Threads

  1. Dcount prevent duplicate
    By ayamali in forum Programming
    Replies: 20
    Last Post: 04-16-2013, 09:31 PM
  2. Problem with code to prevent duplicate entries
    By ResearchRN in forum Programming
    Replies: 5
    Last Post: 11-08-2011, 12:12 PM
  3. Prevent Duplicate Entry
    By kilosierra71 in forum Forms
    Replies: 4
    Last Post: 07-28-2011, 03:08 PM
  4. Replies: 2
    Last Post: 02-12-2011, 09:54 PM
  5. Prevent Duplicate Values on Combination of Two Fields
    By LornaM in forum Database Design
    Replies: 8
    Last Post: 05-05-2009, 11:16 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