Consulting

Results 1 to 2 of 2

Thread: Is it possible to raise an error pop-up message when a user enters duplicated data?

  1. #1
    VBAX Mentor
    Joined
    Aug 2010
    Posts
    457
    Location

    Is it possible to raise an error pop-up message when a user enters duplicated data?

    Is it possible to raise an error message with a pop up box when duplicated data is entered into a field onto a form on a pop up box; either using vba or an expression or a simplier method? I would like to prevent the user from entering duplicated data in particular fields. Is it possible to do this in access? If so how can this be done?


    Thanks for your contributions!

  2. #2
    VBAX Expert Imdabaum's Avatar
    Joined
    Jun 2006
    Posts
    652
    Location
    The key is identifying how it is duplicated. But yes. It's the same logic as the others. Once you have your function identifying whether the data is duplicated, test it. If TRUE call your message box.

    [vba]If Duplicated(txtBox.value) Then
    Msgbox("Duplicate entry")
    End if
    [/vba]

    For an easier option, if the data is directly related to a field in a table, you can mark that field as Indexed(No Duplicates) in the table designer.
    Someday I'll understand everything...
    Even then...I'll still pretend I'm a beginner.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •