Hello,
I would like to use the formula below to help identify duplicates in a subform. In order to do this I created a basic macro using another I found. The problem I am running into is with the criteria. I want to change these <"TheField> and <[Not]>to variables so they update based of the formula but I can't get it to work for some reason. :banghead:
Thank you for any help you can provide.
I would like to use the formula below to help identify duplicates in a subform. In order to do this I created a basic macro using another I found. The problem I am running into is with the criteria. I want to change these <"TheField> and <[Not]>to variables so they update based of the formula but I can't get it to work for some reason. :banghead:
Code:
Is Expression
fnFormat([TheField],[Not],"tblTest")>0
Code:
Public Function fnFormat(strField As String, str_ID As String, tbl As String) As Integer
Dim TheCount As Integer
fnFormat = 0
TheCount = DCount(""" & strField & """, _
"" & tbl & "", _
"TheField = '" & strField & "' And [Not] = '" & str_ID & "'")
If TheCount > 1 Then fnFormat = 1
End Function
Thank you for any help you can provide.