473,401 Members | 2,125 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,401 software developers and data experts.

Print Report With Two Parameters

12
I have created a report which opens with a click button and utilizes two parameters using the following string:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Doc2019_View_Click()
  2.  
  3.     Dim stDocName As String
  4.     Dim stLinkCriteria As String
  5.  
  6.     stDocName = "B_Edit"
  7.     stLinkCriteria = "[ac]=" & "'" & Me![ac] & _
  8.                  "' And [nr]=" & "'" & Me![nr] & "'"
  9.  
  10.     DoCmd.OpenReport stDocName, acPreview, , stLinkCriteria
  11.  
  12. End Sub
  13.  
Works fine. But when attempting to create a Print Button to print the report without previewing it doesn't work. Why?
Feb 25 '19 #1
1 888
nsiotto
12
Sorry was doing a very stupid mistake which has been fixed:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Doc2019_View_Click()
  2.  
  3.     Dim stDocName As String
  4.     Dim stLinkCriteria As String
  5.  
  6.     stDocName = "B_Edit"
  7.     stLinkCriteria = "[ac]=" & "'" & Me![ac] & _
  8.                  "' And [nr]=" & "'" & Me![nr] & "'"
  9.  
  10.     DoCmd.OpenReport stDocName,,, stLinkCriteria
  11.  
  12. End Sub
  13.  
Now works!
Feb 25 '19 #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
1
by: Scott Sabo | last post by:
Hello- I recently modified a database at work to be able to track employee stats in two locations. Formerly, the employees were all in Reno, Nv that were listed in the database, now I have added...
8
by: Mark Flippin | last post by:
This is for a reporting problem using: Access 2000 SQL Server 2000 Both at SP3 I've a stored procedure in SQL Server 2000 which builds a result set from a disparate set of tables, utilizing...
3
by: manning_news | last post by:
Using A2K. I've been asked to modify a report currently requiring only one date parameter to now accept a date range. The main report has 2 subreports and is not bound to a table or query. The...
2
by: ChadDiesel | last post by:
Hello, I have a form and subform with their tables linked by a field called Load_ID. I have a button on my subform that prints just the items listed on that particular subform (looking at...
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: thh108688 | last post by:
Hi All, Is anyone know how to do a print report based on my current record. What i would like to get is once i have entered all the value in the form, when i hit the print button, all the value...
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...
3
by: sconard | last post by:
I have a subform in datasheet view that is the result of a complex vba custom query with a number of parameters. I would like to place a button on the parent form to print the datasheet view as a...
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>...
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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.