By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,846 Members | 1,281 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,846 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"

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

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.

Expand|Select|Wrap|Line Numbers
  1. Private Sub cmdPrint_Click ()
  2. Dim dteMonth as Date
  4. dteMonth = InputBox ("Please enter the month you would like to print", "Enter a month")
  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

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.