Hello all,
I'm trying to create two DCount expressions in one simply to check if two fields are equal to another set of two fields. For example:
abc 123
abc 321
should be okay and return nothing. However,
abc 123
abc 123
should inform the user a duplicate entry is being entered. On my main form I have a subform in which the table of these fields are sourced too.
Here's what I have so far in the before update of the textbox, I believe it's something close to this
But it doesn't seem to to work. Any help is really appreciated since I've been stuck on this for days
I'm trying to create two DCount expressions in one simply to check if two fields are equal to another set of two fields. For example:
abc 123
abc 321
should be okay and return nothing. However,
abc 123
abc 123
should inform the user a duplicate entry is being entered. On my main form I have a subform in which the table of these fields are sourced too.
Here's what I have so far in the before update of the textbox, I believe it's something close to this
Code:
If DCount("Field0","table","Field1=" & Me!field1 & " AND Field2= " & Me!Field2 &"") > 0 Then
MsgBox ("Duplicate Entry")
But it doesn't seem to to work. Any help is really appreciated since I've been stuck on this for days