S
Secret Squirrel
I'm trying to use a dcount function to check if there is a record that
already exists based on the 3 fields within my dcount function. Not sure I
have the syntax correct for the "DateAbsent". I think that's where my problem
is. Can anyone help clear this up?
If DCount("[LogID]", "[tblAttendance]", "[EmployeeID] = " & Me!EmployeeID &
" And [DateAbsent] = #" & Me!DateAbsent & "# And [TypeID] = " & Me!TypeID >
0) Then
MsgBox "Duplicate Entry. Click OK to cancel", vbExclamation
Me.Undo
Else
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
MsgBox "Record has been Saved", vbOKOnly
End If
already exists based on the 3 fields within my dcount function. Not sure I
have the syntax correct for the "DateAbsent". I think that's where my problem
is. Can anyone help clear this up?
If DCount("[LogID]", "[tblAttendance]", "[EmployeeID] = " & Me!EmployeeID &
" And [DateAbsent] = #" & Me!DateAbsent & "# And [TypeID] = " & Me!TypeID >
0) Then
MsgBox "Duplicate Entry. Click OK to cancel", vbExclamation
Me.Undo
Else
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
MsgBox "Record has been Saved", vbOKOnly
End If