A
AJOLSON
I am trying to apply a filter to a series of dates.
An Example is:
I want to filter on all records with dates that fall between Jul, 1,2008 and
July, 7, 2008 (a seven day period) I am using a combo box to try and do this.
Here are the two codes I have used:
Code #1
Me.Filter = "[ProductionDate] >= " & Format(Me.ComboFilterDate,
"\#yyyy\-mm\-dd\#")
Me.Filter = "[ ProductionDate]- 6 <= " & Format(Me. ComboFilterDate,
"\#yyyy\-mm\-dd\#")
Me.FilterOn = True
Code #2
I did try this too but to no avail
Me.Filter = "[ProductionDate] >= and [ProductionDate]-6<= " &
Format(Me.ComboFilterDate, "\#yyyy\-mm\-dd\#")
Neither code works
In Code #1 example of what is happening is the first line is working great
I get all Production dates that are the date selected and higher, However,
when the second filter is applied it wipes out the first one and returns all
records that are 7 days after the selected date to the first date of
production. Which is undesirable.
In Code#2 all I get is a syntax error
(missing Operator ) in query expression ‘[ProductionDate}>=and
[ProductionDate]-7<= #2008-07-25#’
I figure the issue is placing an “and†qualifier in there somewhere but
can’t figure out where to put it.
So any help would be greatly appreciated. Thanks
Andy
An Example is:
I want to filter on all records with dates that fall between Jul, 1,2008 and
July, 7, 2008 (a seven day period) I am using a combo box to try and do this.
Here are the two codes I have used:
Code #1
Me.Filter = "[ProductionDate] >= " & Format(Me.ComboFilterDate,
"\#yyyy\-mm\-dd\#")
Me.Filter = "[ ProductionDate]- 6 <= " & Format(Me. ComboFilterDate,
"\#yyyy\-mm\-dd\#")
Me.FilterOn = True
Code #2
I did try this too but to no avail
Me.Filter = "[ProductionDate] >= and [ProductionDate]-6<= " &
Format(Me.ComboFilterDate, "\#yyyy\-mm\-dd\#")
Neither code works
In Code #1 example of what is happening is the first line is working great
I get all Production dates that are the date selected and higher, However,
when the second filter is applied it wipes out the first one and returns all
records that are 7 days after the selected date to the first date of
production. Which is undesirable.
In Code#2 all I get is a syntax error
(missing Operator ) in query expression ‘[ProductionDate}>=and
[ProductionDate]-7<= #2008-07-25#’
I figure the issue is placing an “and†qualifier in there somewhere but
can’t figure out where to put it.
So any help would be greatly appreciated. Thanks
Andy