Filter by Month

  • Thread starter Thread starter renold
  • Start date Start date
R

renold

I have database, which requires to filter by month.

A form has been created with the necesarry fields,
including one called 'date'.

Option group with 13 buttons has been created...1 for each
month, plus one with 'All'

Date is stored as 01/01/2005 in table..."Short Date", but
appears as 01 Jan 2005 on the form

What is the 'Where Condition'in the 'Action' column and
Apply Filter option........sofar I have... [date] Like

can't seem to get the expression needed to get the
corresponding month......tried the following

[date] like "*01*", but doesn't work.

Can anyone help out please
 
Renold,

Month([date])=1

By the way, the word 'date' is a Reserved Word (i.e. has a special
meaning) in Access, and as such it is not a good idea to use it as the
name of a field or control.
 
Thanks Steve

tried that syntax, but still doesn't seem to work.

followed your advice and changed "date" to "from"

so how would the entire ..Where Condition look now?
-----Original Message-----
Renold,

Month([date])=1

By the way, the word 'date' is a Reserved Word (i.e. has a special
meaning) in Access, and as such it is not a good idea to use it as the
name of a field or control.

--
Steve Schapel, Microsoft Access MVP

I have database, which requires to filter by month.

A form has been created with the necesarry fields,
including one called 'date'.

Option group with 13 buttons has been created...1 for each
month, plus one with 'All'

Date is stored as 01/01/2005 in table..."Short Date", but
appears as 01 Jan 2005 on the form

What is the 'Where Condition'in the 'Action' column and
Apply Filter option........sofar I have... [date] Like

can't seem to get the expression needed to get the
corresponding month......tried the following

[date] like "*01*", but doesn't work.

Can anyone help out please
.
 
Renold,

Maybe it should be like this...
Month([from])=[NameOfYourOptionGroup]

or...
Month([from])=[Forms]![NameOfForm]![NameOfYourOptionGroup]

What event are you assigning this macro on?
 
Back
Top