Filter by Month

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
 
S

Steve Schapel

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.
 
G

Guest

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
.
 
S

Steve Schapel

Renold,

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

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

What event are you assigning this macro on?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top