Results 1 to 2 of 2
  1. #1
    smahdih is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Posts
    52

    check text box after update for duplicate

    i have a form with many fields



    when i type a duplicate value for primary key and save record duplicate error(attach it) is shown.

    i want after update primary key check for duplicate, if is not duplicate other field allowed fill

    how can do this?

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,601
    Use the BeforeUpdate event to check for existing value.

    If Not IsNull(DLookup("fieldname","tablename","fieldname= " & Me.textbox)) Then
    Cancel = True
    MsgBox "ID already used."
    End If
    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. check and return specified text
    By nosiss in forum Queries
    Replies: 7
    Last Post: 05-17-2011, 02:29 PM
  2. Replies: 3
    Last Post: 05-15-2011, 08:40 AM
  3. check for duplicate First and Last names?
    By newtoAccess in forum Access
    Replies: 3
    Last Post: 03-19-2011, 04:05 PM
  4. Replies: 0
    Last Post: 03-09-2011, 02:59 PM
  5. Duplicate Check code with Run-Time error '3079'
    By viper in forum Programming
    Replies: 5
    Last Post: 10-18-2010, 10:12 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