Create a year table with one field named SelectYear and put the years you
will be using in that table. Create a month table with two fields named
month number and monthname so you have a records like 1,Jan. Create a pop-up
form named PFrmDateCriteria with two comboboxes. Name the first combobox
"MonthCriteria" and base it on your month table. Set the bound Column to 1,
Column Count to 2 and Column Width to 0;.5. Name the second combobox
"YearCriteria" and base it on your yera table. Set Bound Column to 1, Column
Count to 1 and Column Width to .5.
Create your query and include the fields you need. In the first blank field
in your query, type in this expression:
SelectedYear:Year([NameOfYourDateField]) and set the criteria to:
Forms!PFrmDateCriteria!YearCriteria. In the second blank field in your
query, type in this expression:
SelectedMonth:Month([NameOfYourDateField]) and set the criteria to:
Forms!PFrmDateCriteria!MonthCriteria.
You now need to open the pop-up form, select the month and year and then
open your form or report that is based on your query and you will only get
the records for the year and month you selected.
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com
KAnoe said:
I would like to have a Query that the user will only need put in the month
and year and the Query will only give them record that fall in that month.
Jan 2005 is what I would like the user to type in.
Thanks
Keith