BDCarrillo
Technical User
Trying to prevent a duplicate record from being added by the following logic:
"If there arent any records that already have the same start date and shop code, allow record creation"
In the Roster_Data table, [Start_Date] is a date and [Shop_Code] is a Long.
sDate and sCode are pulling data from an unbound "submission" form.
I've dug around a lot and tried different formatting/syntax but keep running into problems. I'm sure its just an issue of a misplace quotation mark, but can't figure it out.
"If there arent any records that already have the same start date and shop code, allow record creation"
In the Roster_Data table, [Start_Date] is a date and [Shop_Code] is a Long.
sDate and sCode are pulling data from an unbound "submission" form.
Code:
Dim sDate As Date
Dim sCode As Long
sDate = Me.Start_Date1.Value
sCode = Me.Shop_Code.Value
If DCount("[ID]", "Roster_Data", "[Start_Date]= #" & sDate & "#" And [Shop_Code] = sCode) = 0 Then
I've dug around a lot and tried different formatting/syntax but keep running into problems. I'm sure its just an issue of a misplace quotation mark, but can't figure it out.