Hi,
I want to eliminate duplicate data entry by using DCount. I have 'Name', 'Date and 'Status' fields. The condition requires that only unique entry is allowed in Status field for a specific Date and Name.
I have used the following code, but encountered syntax error in Dcount statement.
Private Sub Combo10_BeforeUpdate(Cancel As Integer)
Dim tot As Integer
Dim ddd As Date
Dim sss As String
tot = DCount("[status]", "Table1", "[Date]= # ddd # and [Name]= # sss #")
If tot > 0 Then
MsgBox "This information duplicates another record."
Exit Sub
End If
End Sub
Any help will be great.
Moin
I want to eliminate duplicate data entry by using DCount. I have 'Name', 'Date and 'Status' fields. The condition requires that only unique entry is allowed in Status field for a specific Date and Name.
I have used the following code, but encountered syntax error in Dcount statement.
Private Sub Combo10_BeforeUpdate(Cancel As Integer)
Dim tot As Integer
Dim ddd As Date
Dim sss As String
tot = DCount("[status]", "Table1", "[Date]= # ddd # and [Name]= # sss #")
If tot > 0 Then
MsgBox "This information duplicates another record."
Exit Sub
End If
End Sub
Any help will be great.
Moin