Search Criteria

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I get the following error message: Run Time 3075
Syntax error (missing operator) in querry expression '(area_jqharena = AND [MoveInDate] between #1/1/2004# AND $6/1/2004#)'

Here is the code I have in place:
strwhere = "area_JQHArena = " & True_ & " AND " & "[MoveInDate] between #" & Me.txtStartDate & "# AND #" & Me.txtEndDate & "#"

I am sure I made a typo somewhere. I just cant seem to find it
Any help you could give would be appreciated
 
Not sure what True_ is, but guessing that it's meant to be the Boolean value
True and the line continuation character, put a space between True and the _
character.

--
Ken Snell
<MS ACCESS MVP>

Todd said:
I get the following error message: Run Time 3075
Syntax error (missing operator) in querry expression '(area_jqharena = AND
[MoveInDate] between #1/1/2004# AND $6/1/2004#)'
Here is the code I have in place:
strwhere = "area_JQHArena = " & True_ & " AND " & "[MoveInDate] between #"
& Me.txtStartDate & "# AND #" & Me.txtEndDate & "#"
 
OK - the _ character is used as a line continuation notation when at the end
of a code line and preceded by a space.

Try this:

strwhere = "area_JQHArena = True AND " & "[MoveInDate] between #" &
Me.txtStartDate & "# AND #" & Me.txtEndDate & "#"

--
Ken Snell
<MS ACCESS MVP>

Todd said:
I was trying to create a filter where only data that would appear would be
data where [area-jqharena] field is true and is between the two dates
specified in txtStartDate and txtEndDate.
 
Note: the line of code that I posted is intended to be all on one line.

If you want to split it into separate lines, use this (line breaks are
real):

strwhere = "area_JQHArena = True AND " & _
"[MoveInDate] between #" & Me.txtStartDate _
& "# AND #" & Me.txtEndDate & "#"


--
Ken Snell
<MS ACCESS MVP>

Ken Snell said:
OK - the _ character is used as a line continuation notation when at the end
of a code line and preceded by a space.

Try this:

strwhere = "area_JQHArena = True AND " & "[MoveInDate] between #" &
Me.txtStartDate & "# AND #" & Me.txtEndDate & "#"

--
Ken Snell
<MS ACCESS MVP>

Todd said:
I was trying to create a filter where only data that would appear would
be
data where [area-jqharena] field is true and is between the two dates
specified in txtStartDate and txtEndDate.
I am new to code. I am not sure what the _ even does.
 
Just to add a curve to this... the dates need to be in usa
format regardless of system setting. If required to force
conversion use the following as example...

strwhere = "area_JQHArena = True AND " & _
"[MoveInDate] between #" & format
(Me.txtStartDate,"m/d/yy") _
& "# AND #" & format(Me.txtEndDate,"m/d/yy") & "#"

Luck
Jonathan

-----Original Message-----
Note: the line of code that I posted is intended to be all on one line.

If you want to split it into separate lines, use this (line breaks are
real):

strwhere = "area_JQHArena = True AND " & _
"[MoveInDate] between #" & Me.txtStartDate _
& "# AND #" & Me.txtEndDate & "#"


--
Ken Snell
<MS ACCESS MVP>

OK - the _ character is used as a line continuation
notation when at the
end
of a code line and preceded by a space.

Try this:

strwhere = "area_JQHArena = True AND " & "[MoveInDate] between #" &
Me.txtStartDate & "# AND #" & Me.txtEndDate & "#"

--
Ken Snell
<MS ACCESS MVP>

I was trying to create a filter where only data that
would appear would
be
data where [area-jqharena] field is true and is between the two dates
specified in txtStartDate and txtEndDate.
I am new to code. I am not sure what the _ even does.


.
 
Back
Top