473,614 Members | 2,328 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

controling which report to print in VB



Hi,

I have 4 reports created in Ms-access and I will use VB to print those
reports. My problem is I'm not sure if I can control wich report to
print..

Those reports are almost the same, what is different is the logo in the
report header or page header.
Because there are 4 different logo. I want the user to choose in VB
which logo to use and then VB will print the report that the user chose.
Is that possible? I'm new in using reports so any suggestions?
Cheers!

Claudi

*** Sent via Developersdex http://www.developersdex.com ***
Nov 13 '05 #1
2 1780
On Mon, 01 Aug 2005 03:16:11 GMT, Claudia Fong
<cd********@yah oo.co.uk> wrote:

Delete 3 reports.

Then in the Report_Open event of the remaining one, write something
like:
imgLogo.Picture = <path_to_logo >

Now how you determine which logo to print depends on the details of
your app. If it's one of 4 buttons ("print rpt 1", "print rpt 2" etc),
then it's simple. On some more recent versions of Access there is a
more elegant solution, but this works in all:
On the form that launches the reports, put a hidden textbox. Name it
txtLogoPath. Then in the buttons' click events write:
txtLogoPath.Val ue = "c:\test\logo1. jpg"
and for button 2:
txtLogoPath.Val ue = "c:\test\logo2. jpg"
etc.

Then in Report_Open you can refer to that hidden control. Assuming
your form with buttons is called frmPrintReports :
imgLogo.Picture = Forms!frmPrintR eports!txtLogoP ath.Value

On more recent versions of Access you can use the OpenArgs argument to
DoCmd.OpenRepor t to send the logo_path to the report.

A more robust implementation of Report_Open would check for the
existence of the image (using the Dir function), and perhaps show a
static 'broken link' image if not found.

-Tom.



Hi,

I have 4 reports created in Ms-access and I will use VB to print those
reports. My problem is I'm not sure if I can control wich report to
print..

Those reports are almost the same, what is different is the logo in the
report header or page header.
Because there are 4 different logo. I want the user to choose in VB
which logo to use and then VB will print the report that the user chose.
Is that possible? I'm new in using reports so any suggestions?
Cheers!

Claudi

*** Sent via Developersdex http://www.developersdex.com ***


Nov 13 '05 #2
"Claudia Fong" wrote
I have 4 reports created in Ms-access
and I will use VB to print those
reports.


Do you mean you want to run and print the Access reports from an application
developed using the separate Visual Basic language product, or do you simply
mean Access VBA (Visual Basic for Applications)? Don't worry -- that's not a
chastisement; even Microsoft is not precise in their use of the terms.

Larry Linson
Microsoft Access MVP
Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1970
by: Joe Saliba | last post by:
Hi Folks, am working on an archiving project which they use a little format of paper on which they type on it code and descriptions on each line, and they append on it new lines later on via a typewriter.......... and since we gonna automate this work am facing a slight prob..... So my question is can i from access reports control from which position i want to start printing ???
5
2282
by: wrytat | last post by:
If I want to print report in a web application, should I use Crystal Report? Is it supported by all windows web server? I also read that I can only make a user view a Crystal Report in a web application, but can't print it. To print, the user have to click "File|Print" in the web browser to print. Is this true? Can't I have a "Print" button on the page to print the Crystal Report?
2
3844
by: wahid_kalo | last post by:
Hi There I Have Finished A Point Of Sale Program On Access, I Still Need To ControlThe Cash Register Drawer By Code. In The Manual It Is Mentionned To Open The Drawer through com1 under qbasic OPEN "COM1:300,N8,1" FOR RANDOM AS #1 PRINT #1,"0000000000"
1
1931
by: Stinky Pete | last post by:
Evening, I have a form that uses 5 pages (it's an electronic copy of the paper version) we are going to use for manufacturing non conformances and product deviations. In case your wondering, it's 5 pages to get the risk assessment done before it gets to my area in QA and the db is a way to electronically archive the information for regulatory compliance reporting. Anyway, I've been merrily going along making a report the same as the...
2
1478
by: Hexman | last post by:
Hello All, I'm nearing the end of my current project and the users came up with 2 more requests. I'll talk about the first one in this message. I've developed (with much help from this group) a vb.net app and is being put into the users hands this week. I am using Crystal Report X to produce reports. The users now, rather than printing, want them emailed and produced in .pdf format also. So rather than me re-inventing the wheel, I'm...
0
2964
by: John Smith | last post by:
Hello, I am developing a VB.NET 2003 application that will use lots of Crystal Reports. Sometimes the users will preview a report in a Crystal report viewer, and sometimes they will send the report directly to the printer bypassing the Crystal report viewer altogether. When sending the job directly to the printer I use the PrintToPrinter command CR.PrintToPrinter(1, False, 0, 0)
3
1485
by: fauxanadu | last post by:
I have a report called rptFilter. In my frmPrint Form, I have four option controls that allow for selection of specific criteria to contol what appears in the report. I also have two text boxes (txtHeader1, txtHeader2) that I want to use to change the header labels in the report (lblHeader1, lblHeader2). When the user clicks the print button, this code runs: Select Case Me!fraWhere Case 1 DoCmd.OpenReport...
12
3525
by: Studiotyphoon | last post by:
Hi, I have report which I need to print 3 times, but would like to have the following headings Customer Copy - Print 1 Accounts Copy - Print 2 File Copy -Print 3 I created a macro to print the report three times, but do not know how
11
7320
by: Gord | last post by:
When I open a certain report, it runs some code that generates the records that will be displayed in that report. This works fine. When I go to print preview the report it appears that the code is run again? This is causing certain error problems. 1 Why does the code run for a print preview when the report already exists? 2 What command do I use in code to find out if a report (or any other object for that matter) is already...
0
8198
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8642
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
7115
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6093
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5549
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4138
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2575
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1758
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1438
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.