If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Report by month
I have some reports I need to run on monthly activities. Until now I've had
the parameters in the Date field in my query "Between [First Date] and [Second Date]". Is there a better way of selecting date parameters? Specifically, is there a way to simply specify a previous month and also current month to date? |
#2
|
|||
|
|||
Report by month
Bill Neilsen wrote:
I have some reports I need to run on monthly activities. Until now I've had the parameters in the Date field in my query "Between [First Date] and [Second Date]". Is there a better way of selecting date parameters? Specifically, is there a way to simply specify a previous month and also current month to date? A common approach it to use a form button to launch the report. You can then use one ot two text boxes to allow users to specify the month or a date range. The trick with this approach is to use the OpenReport method's WhereCondition argument to apply the filter so neither the report nor its record source table/query is aware of the filtering criteria. If all you want is to specify a month number in a text box on the form, the code in the button"s Click event procedure woul;d look something like: Dim stCriteria As string If Is Null(Me.textbox) Then MsgBox "Please specify the month number" Else stCriteria = "Month(datefield) = " & Me.textbox DoCmd.OpenReport "reportname", acPreview, , stCriteria End If -- Marsh MVP [MS Access] |
Thread Tools | |
Display Modes | |
|
|