Just the month please

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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.
 
Thanks I will give it a shot!!

PC Datasheet said:
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
 

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

Similar Threads

Access Count dates within a Month 4
Columns using month and year 1
Null Month records for a field 2
Months 2
grouping quarters 3
crosstab problem 2
How to ignore the Year in a Date - Query 5
Keeping 12 months of records 6

Back
Top