Want notification when duplicate value for field is entered

D

DLongsmith

Greetings, thanks for assisting a newbie trying to stay afloat.

I'm designing a form that would notify the data enterer when a duplicate
value is entered into a particualr field. This field identifies a specific
production run of our product and we want to be notified witha pop-up box
when duplicate comments are made about the same production run for our QA
team.

Most duplication features I've seen so far are for eliminating duplicates, I
don't want elimination, I want notification and then allow the entry process
to continue.

thanks inadvance for any guidance.

David
 
K

Klatuu

Given the freeform nature of comments, it may be difficult to get a match,
but the basic idea of any duplicate check on a field is to use the field's
Before Update event to do a DLookup on the field and take appropriate action.

In your case, you would be doing a DLookup on the comments field filter by
production run. I don't know your naming, so I will make them up for the
example:

If Not (IsNull(DLookup("[Comments]", "SomeTable", "[ProductionRun] = '" &
Me.txtProductionRun & "' And [Comments] Like '*" & Me.txtComments & "*'"))
Then
If MsgBox("Similar Comments Found - Ok to Continue", vbQuestion +
vbOkCancel) = vbCancel Then
Cancel = True
End If
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top