Monthly Report

m17347047711116

Registered User.
Local time
Today, 21:13
Joined
Feb 4, 2002
Messages
68
I have a form that i use to pull the criteria for a query to print a report. Currently i have [start date] and [end date] what i would like to be able to do is also have a list box where i could pull down a list of the months jan, feb, mar, apr ect. and when i select the desired month in the list box it will automatically change the values in the start date and end date fields to be the 1st of the selected month and the end date to the last day of the selected month.

thank you
 
First, have a Combo Box (CmboDate) with the Row Source Type set to Value List. Have the Row Source be Jan;Feb;Mar ...

Then, in the BeforeUpdate Event, have


Me.Start_Date = CDate("01-" & Me.CmboDate & "-" & DatePart("yyyy", Date))
Me.End_Date = DateAdd("d", -1, DateAdd("m", 1,Me.Start_Date))

Then have your criteria in the query reference Start_Date & End_Date on the form.

Give that a try

This assumes you want the current year, otherwise you will need to specify that as well. There are some nifty ActiveX Calendar controls that you may also want to use
 
Last edited:

Users who are viewing this thread

Back
Top Bottom