N
Nathan Wolfe
In my form when a user adds stats I want to use Dlookup to see if the user is
trying to enter a duplicate. Here's what I have already:
If (DLookup("[RegularStopID]", "[tblStops]", "[Location] = '" &
Me!cboLocation & "'"))
Then
(Some kind of warning)
This piece of code works fine, but I need to use more than location; I need
to use a date and time as well.
This piece of code also works:
If Not IsNull(DLookup("[RegularStopID]", "tblStops", "[Datestop] = #" &
Me!cboDate & "#"))
Then
(Some kind of warning)
But this doesn't work:
If (DLookup("[RegularStopID]", "[tblStops]", "[Location] = '" &
Me!cboLocation & "'" And "[Datestop] = #" & Me!cboDate & "#"))
Then
(Some kind of warning)
I get a "Type Mismatch" error. Is it not possible to do what I'm trying to
do, or is my syntax wrong? I'd appreciate any hlep.
trying to enter a duplicate. Here's what I have already:
If (DLookup("[RegularStopID]", "[tblStops]", "[Location] = '" &
Me!cboLocation & "'"))
Then
(Some kind of warning)
This piece of code works fine, but I need to use more than location; I need
to use a date and time as well.
This piece of code also works:
If Not IsNull(DLookup("[RegularStopID]", "tblStops", "[Datestop] = #" &
Me!cboDate & "#"))
Then
(Some kind of warning)
But this doesn't work:
If (DLookup("[RegularStopID]", "[tblStops]", "[Location] = '" &
Me!cboLocation & "'" And "[Datestop] = #" & Me!cboDate & "#"))
Then
(Some kind of warning)
I get a "Type Mismatch" error. Is it not possible to do what I'm trying to
do, or is my syntax wrong? I'd appreciate any hlep.