PDA

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



wedd
12-29-2010, 04:25 PM
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!:friends:

Imdabaum
12-30-2010, 09:49 AM
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.

If Duplicated(txtBox.value) Then
Msgbox("Duplicate entry")
End if


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.