473,287 Members | 1,588 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,287 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 1347
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...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.