This an If THEN expression in Visual Basic for Access working db to check if a new record that is entered into a table via a form is already in the
table so as to not put two identical records into the same table.
Code:
'Verify form is filled
If Me.Dirty Then
'Verify that personnel is not already in database
If DCount("*", "qryFindDuplicatePersonnel") > 0 Then
verifyBox = MsgBox("There is already a record with that name. Would you like to add another?", vbOKOnly, "Duplicate Name")
If verifyBox = vbNo Then
Exit Sub
End If
End If
Now I understand the program comments on the IF-ENDIF statement, but I do not understand the line
Code:
If DCount("*", "qryFindDuplicatePersonnel") > 0 Then
verifyBox = MsgBox("There is already a record with that name. Would you like to add another?", vbOKOnly, "Duplicate Name")
If verifyBox = vbNo Then
I have not found a good tutorial on the internet that discusses this statement in detail. If someone could provide a link that
goes in this VBA statement (and ones like it in detail) it would be greatly appreciated.
Thanks in advance.
Respectfully,
Lou Reed