josephbupe
Registered User.
- Local time
- Today, 15:02
- Joined
- Jan 31, 2008
- Messages
- 247
Hi,
I am trying to use a DCount Function to prevent users from creating duplicate records, but i am getting a type mismatch error. The function is as follows: -
Any help will be appreciated.
http://www.easyaccess.up4.net/josephbupe
I am trying to use a DCount Function to prevent users from creating duplicate records, but i am getting a type mismatch error. The function is as follows: -
Code:
Private Sub Form_BeforeInsert(Cancel As Integer)
If DCount("*", "[T_Training_Programmes]", "[Programme Name] = '" & Me.[txtProgrammeName] And "[Country] = '" & Me.[cboVenue] & "'") <> 0 Then
Cancel = True
MsgBox "cannot save duplicate", vbExclamation, "Duplicate"
End If
End Sub
Any help will be appreciated.
http://www.easyaccess.up4.net/josephbupe