By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,490 Members | 896 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,490 IT Pros & Developers. It's quick & easy.

Print a certain group on a report

P: 3
Hey all, what I want to try to accomplish in Access 2007 is to create a button on a form that will print a month's worth of records from a report.

The report is setup like this

"Date by Month"
______"Group 2"
____________"Data"

I apologize for my inexperienced explaination.
Aug 19 '08 #1
Share this Question
Share on Google+
3 Replies


hyperpau
Expert 100+
P: 184
Program your command button in VBA to open up the report specifying a WHERE Condition on the [DateByMonth] field (if that's your field name).
Of course to do this, you would need to have an option for the user to select or type in the month that they want to print. I could either be popup box ar more simply an Input Box, o rmaybe another field/control on the form.

Example:
Expand|Select|Wrap|Line Numbers
  1. Private Sub cmdPrint_Click ()
  2. Dim dteMonth as Date
  3.  
  4. dteMonth = InputBox ("Please enter the month you would like to print", "Enter a month")
  5.  
  6. docmd.openreport "rptMyReport", , , "[Date]=" & dteMonth
  7. End Sub
Of course you will need some modification based on the current set up of your form/table/report.
Aug 19 '08 #2

P: 3
Thanks hyperpau for the response. I'll play around some with modify my db.
Aug 19 '08 #3

hyperpau
Expert 100+
P: 184
No Problem. Hope you find the solution.

Thanks hyperpau for the response. I'll play around some with modify my db.
Aug 19 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.