G
Grant Nicholson
i am working on a form with command buttons to select a month to list all
employees birthdays for the given months. the query works perfect when the
criteria is set to enter month using the expression
(DatePart("m",[DateOfBirth])). i don't want to have to enter the date but
simply pass the value from the button using the click event. the following
statement:
DoCmd.OpenReport "repEmployeeBirthdays", acViewPreview, , _
((DatePart("m", [tblPeakeEmployees.DateOfBirth])) = 1)
returns an error statement that "access cannot find field "|" referred to in
expression". i've removed the table reference and get the same error
message.
if i put the month number in the criteria section it returns the correct
values.
i am looking for a way to pass the month number on the click event of the
buttons instead of having to create 12 reports with 12 different queries.
any ideas?
employees birthdays for the given months. the query works perfect when the
criteria is set to enter month using the expression
(DatePart("m",[DateOfBirth])). i don't want to have to enter the date but
simply pass the value from the button using the click event. the following
statement:
DoCmd.OpenReport "repEmployeeBirthdays", acViewPreview, , _
((DatePart("m", [tblPeakeEmployees.DateOfBirth])) = 1)
returns an error statement that "access cannot find field "|" referred to in
expression". i've removed the table reference and get the same error
message.
if i put the month number in the criteria section it returns the correct
values.
i am looking for a way to pass the month number on the click event of the
buttons instead of having to create 12 reports with 12 different queries.
any ideas?