Want to query data by Month

Jon123

Registered User.
Local time
Today, 14:06
Joined
Aug 29, 2003
Messages
668
I want to have a command button on a form (Monthly Report) user selects this cmd and a Month Calendar pops up so the user may select a month and then the query would run between the 1st and last day for that month. Has anyone seen something like this? I have been searching and finding alot of calendars but I want to limit the search by Month.

jon
 
If all the user needs to select is a month, I think a combo box with the 12 months would be a good solution.

You can also make your own form with 12 buttons with the Month label on the the buttons.

When they click on the button you have your month.
 
I want to have a command button on a form (Monthly Report) user selects this cmd and a Month Calendar pops up so the user may select a month and then the query would run between the 1st and last day for that month. Has anyone seen something like this? I have been searching and finding alot of calendars but I want to limit the search by Month.

jon
The combo box suggestion from ions is a good one.

But is it the current month of the current year? What if they want to see previous years or does that not matter?

Or just the current month's records regardless of year?
 
The combo box suggestion from ions is a good one.

But is it the current month of the current year? What if they want to see previous years or does that not matter?

Or just the current month's records regardless of year?

I agree.

I'd go for a couple of comboboxes for month & year then set the query criteria to something like:

Between DateSerial(cboYear,cboMonth,1) and Iif(cboMonth=12,DateSerial(cboYear+1,1,1),DateSerial(cboYear,cboMonth+1,1))

From memory the first date is inclusive and the second isn't when using between. If not then add a -1 after the two DateSerials in the Iif statement.

Code as is, no warrenty, etc, etc.
 

Users who are viewing this thread

Back
Top Bottom