A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Report by month



 
 
Thread Tools Display Modes
  #1  
Old September 6th, 2006, 03:00 AM posted to microsoft.public.access.reports
Bill Neilsen
external usenet poster
 
Posts: 47
Default 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  
Old September 6th, 2006, 05:28 AM posted to microsoft.public.access.reports
Marshall Barton
external usenet poster
 
Posts: 5,361
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:16 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.