473,387 Members | 1,812 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Print a report from a query

102 64KB
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

1 1354
jforbes
1,107 Expert 1GB
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

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

Similar topics

0
by: Michael Dekson | last post by:
Access 97. I make a report and I want first to see report and then print report without type CONTROL + P. Can I make some button or can I see print button in toolbar meny. Thanks
7
by: Mike | last post by:
I have to pass a date from a form to a report query. I have written a query that works fine when I execute from SQL view, But I dont know how to pass a value from the form to this query. SELECT...
5
by: Tony Dong | last post by:
Hi there, I am newer for dot net I want to make a report and then print it, the report may include images and text, how can I do that, any one can give me a suggestion? I know how to...
1
by: z.ghulam | last post by:
I am designing an order database at work and am having problems creating a specific report I'm after. Basically, each order has an 'order type' and what I would like is a report which lists the...
14
by: ineedahelp | last post by:
I have included a snip of my code. I am trying to output my results to a report or a query. Right now I can see my results in the immediate window due to my DEBUG command. how can I take these...
2
by: mudman04 | last post by:
Hi, I searched online for some similar issues that I am facing but was not able come up with anything. I am fairly new with Access (2 months experience) and I am trying to remove a message...
2
by: felicia | last post by:
Can anyone help me on How to use Data Report in VB and how to print report? I hope i can generate the Data Report without Data Environment because I am not fammiliar with it. Simple adodb or adodc...
1
by: abil | last post by:
i've already build a program that contain all the price, the change given back to the customer but i dun have no idea which function i should use to do program print report... #include <cstdlib>...
11
tuxalot
by: tuxalot | last post by:
The easy way is to put cancel = True in the On No Data event of the report. But why replicate code across all reports that way? My app selects reports from a listbox, so I would prefer to check the...
1
by: ncsthbell | last post by:
I created a form "frmReportParms", on this form I have created a combo box box which lists 'divisions'. I put code behind the 'after click' event on the combo box to move the value selected to a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.