Results 1 to 2 of 2
  1. #1
    Traviscon is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    May 2012
    Posts
    1

    Duplicate ID Message

    Hi everyone,

    I have a table called "shapes" with a unique ID field in that table.

    When I add the shapes to the table, if it is a duplicate, it doesn't complete until the whole of the form is complete. Is there anyway you can set it so that if this single unique field is a duplicate, a message will popup instantly once the mouse goes onto the next field?

    Regards,


    Travis

  2. #2
    JeroenMioch's Avatar
    JeroenMioch is offline Competent Performer
    Windows Vista Access 2003
    Join Date
    May 2012
    Location
    Den Haag, Netherlands
    Posts
    368
    Yes you can detect duplicate entries in any field of a table.

    In my next example i do exactly this.

    Private Sub Sticker_BeforeUpdate(Cancel As Integer)
    Dim Answer As Variant
    Answer = DLookup("[Sticker]", "Parkeerbeheer", "[Sticker] = '" & Me.Sticker & "'")
    If Not IsNull(Answer) Then
    MsgBox "This Sticker number is allready in use" & vbCrLf & "Please check if the number is correct" & vbCrLf & "Use a new sticker", vbCritical + vbOKOnly + vbDefaultButton1, "Double entry"

    Cancel = True
    Me.Sticker.Undo

    Else
    End If
    End Sub

    You can customize it to your situatium by changing the fields and table.

    Hope it helps

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. Need Help with message box.
    By Grahamvdh in forum Programming
    Replies: 1
    Last Post: 05-10-2012, 01:29 PM
  3. Message Box
    By dr223 in forum Access
    Replies: 11
    Last Post: 01-12-2012, 11:59 AM
  4. Message Box
    By dunnmel4 in forum Programming
    Replies: 9
    Last Post: 04-12-2011, 10:44 PM
  5. Replies: 4
    Last Post: 08-26-2010, 09:44 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