I have a form (frmCRMEditRF)with a textbox (txtActionNumber) and a subform (CRMPartsRF) with a combo box (cboPartNumber).
I need to check the records in tblRepReport table to check if a record has already been saved by looking to see if there is a record with the contents of txtActionNumber (saved RPIdentifier inthe table)and cboPartNumber (saved in ProductID) that match those in the open form (frmCRMEditRF)
txtActionNumber has input similar to text + date eg computer020520, making it a text field. cboPartNumber records an autonumber eg1426
I have tried dozen of code examples without success
MY CODE"
Dim CHKID As String
Dim CHKProdID As Long
Dim Tot As Double
CHKID = Me!txtActionNumber
CHKProdID = Me!frmCRMPartsRF!cboPartNumber
'Tot = DCount("[RepReportID]", "tblRepReport", "[ProductID] = CHKProdID" And "[RPIdentifier] = '" & CHKID & "'")
If Tot > 0 Then
MsgBox "This record already exists", vbOKOnly + vbExclamation, "Duplicate Record"
End If
Thanks in advance
Bob