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

Print a report from a query

100+
P: 102
Background:
Front end: MS Access 2010/VBA
Back end: MS SQL Server 2008

I have a MS Access database that has a report and it works fine. The report lists evaluations on every supplier
in the database. I have a form/subform that displays every supplier in the database. Is there a way to select a
supplier and print just that supplier's evaluation?

Thank you in advance.
Jun 19 '15 #1

✓ answered by jforbes

The following code is something I use to Print a Report and limit the Report by Primary Key to the Primary Key of the Current Record shown on the Form:
Expand|Select|Wrap|Line Numbers
  1. Private Sub cmdPrintTag_Click()
  2.     Dim sJobNumber As String
  3.     sJobNumber = Nz(Me!JobNumber, "")
  4.     If Len(sJobNumber) > 0 Then DoCmd.OpenReport "JobTag", acViewNormal, , "JobNumber='" & sJobNumber & "'"
  5. End Sub

Share this Question
Share on Google+
1 Reply


jforbes
Expert 100+
P: 1,107
The following code is something I use to Print a Report and limit the Report by Primary Key to the Primary Key of the Current Record shown on the Form:
Expand|Select|Wrap|Line Numbers
  1. Private Sub cmdPrintTag_Click()
  2.     Dim sJobNumber As String
  3.     sJobNumber = Nz(Me!JobNumber, "")
  4.     If Len(sJobNumber) > 0 Then DoCmd.OpenReport "JobTag", acViewNormal, , "JobNumber='" & sJobNumber & "'"
  5. End Sub
Jun 19 '15 #2

Post your reply

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