Results 1 to 2 of 2
  1. #1
    captainrod is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2021
    Posts
    1

    duplicate field enty - indexed - hyperlink field

    Field: referral-web



    Type: hyperlink

    Indexed set to " yes - no duplicates " ((I want to prevent having duplicate website addresses)).

    It allows me to enter the duplicate data and when I go to the next record, it gives me the error message.

    Unfortunately, I have entered 20 fields of data after the "indexed yes" field.

    How can I get a warning etc after I enter the duplicate data without filling in the additional 20 fields of data?

    First time posting. Hope I did it correctly.

  2. #2
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,235
    In the BeforeUpdate of the control bound to [referral-web] add a validation using a dCount:
    Code:
    if dCount("*","tblYourTableName]","[referral-web]=""" & Me.txtReferralWeb & """")>0 then
    msgbox "You already have this web site!"
    Cancel=True
    End if
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

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

Similar Threads

  1. Replies: 6
    Last Post: 09-09-2020, 10:28 PM
  2. Replies: 8
    Last Post: 03-29-2017, 09:07 AM
  3. Replies: 10
    Last Post: 08-08-2016, 07:30 PM
  4. Need design suggestions for indexed-no duplicates field
    By jax1000rr in forum Database Design
    Replies: 3
    Last Post: 01-29-2013, 06:42 AM
  5. PK field, indexed-no duplicates shows twice in query
    By jhollingsh615 in forum Database Design
    Replies: 2
    Last Post: 05-26-2011, 05: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