473,785 Members | 2,167 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to make access ask you which report you want to print

14 New Member
What's up forum,
Is this possible? Is there a way to have access ask the end user which report you want to print? If so, how.
Feb 1 '08 #1
8 1757
ADezii
8,834 Recognized Expert Expert
What's up forum,
Is this possible? Is there a way to have access ask the end user which report you want to print? If so, how.
  1. Populate a Combo Box (cboReports) with a list of all Reports in the Database:
    Expand|Select|Wrap|Line Numbers
    1. Dim aob As AccessObject
    2.  
    3. Me![cboReports].RowSourceType = "Value List"
    4.  
    5. For Each aob In Application.CurrentProject.AllReports
    6.   Me![cboReports].AddItem aob.Name
    7.   Debug.Print "  " & aob.Name
    8. Next aob
  2. Open the Report selected from the Combo Box by the User:
    Expand|Select|Wrap|Line Numbers
    1. DoCmd.OpenReport Me![cboReports], acViewPreview, , , acWindowNormal
Feb 1 '08 #2
dponce
14 New Member
Thx for the quick response.

This is good news even if I am somewhat lost, because that just means it can be done. I know how to create a combo box, just not sure what populate means or how to do it. Would I enter cboReports within the Row Source? where would I put your generous VB code? Sorry for being so ignorant, I am learning and catching on quit quickly.
Feb 1 '08 #3
dponce
14 New Member
I have been playing around with the info mentioned above, trying to get it going but by doing so; I had realized maybe this wouldn't work. Correct me if I am wrong. For some reason, I feel that if this code does work it will end up showing me ALL the reports under Reports. If this is the case, would there be a way to have access ask the end user which report to print by maybe something like a message box where they can type in the name of the report. Something that acts like a Query Parameter [Enter Report Name].Hope this isn't too much to ask for and your help is greatly appreciated.
Feb 1 '08 #4
ADezii
8,834 Recognized Expert Expert
I have been playing around with the info mentioned above, trying to get it going but by doing so; I had realized maybe this wouldn't work. Correct me if I am wrong. For some reason, I feel that if this code does work it will end up showing me ALL the reports under Reports. If this is the case, would there be a way to have access ask the end user which report to print by maybe something like a message box where they can type in the name of the report. Something that acts like a Query Parameter [Enter Report Name].Hope this isn't too much to ask for and your help is greatly appreciated.
Selecting the Report to Print from a Combo Box is by far the better selection, but if you still wish to prompt the User, I'll show you how. Let me know one way or the other what you decide.
Feb 1 '08 #5
NeoPa
32,578 Recognized Expert Moderator MVP
I have been playing around with the info mentioned above, trying to get it going but by doing so; I had realized maybe this wouldn't work. Correct me if I am wrong. For some reason, I feel that if this code does work it will end up showing me ALL the reports under Reports. If this is the case, would there be a way to have access ask the end user which report to print by maybe something like a message box where they can type in the name of the report. Something that acts like a Query Parameter [Enter Report Name].Hope this isn't too much to ask for and your help is greatly appreciated.
Putting them in the ComboBox doesn't print them all - it simply allows the operator to select from a predefined list. When they select one, the value of the ComboBox is set to the one selected - that being the report they've selected to print.
Feb 1 '08 #6
ADezii
8,834 Recognized Expert Expert
Putting them in the ComboBox doesn't print them all - it simply allows the operator to select from a predefined list. When they select one, the value of the ComboBox is set to the one selected - that being the report they've selected to print.
Thanks a lot NeoPa, the more obvious something is, the more I seem to miss it! (LOL).
Feb 2 '08 #7
NeoPa
32,578 Recognized Expert Moderator MVP
;) No Probs ADezii.
I fall over the same sorts of thing myself quite often.
Feb 2 '08 #8
missinglinq
3,532 Recognized Expert Specialist
As ADezii said, using a combobox is by far the preferred method of doing this! Having the user enter a report name in a textbox requires them to remember the exact name of the report, otherwise they'll get nothing! And relying on users' memory is always dicey, at best!

The user doesn't even have to scroll thru the combobx if they don't want to! With the combobox's Auto Expand Property set to Yes (which is the default) the user can start to type the report name in and Access will go to the corresponding portion of the list; each letter typed will bring them closer to the needed report.

Using this tiny snippet of code:

Expand|Select|Wrap|Line Numbers
  1. Private Sub YourComboBox_GotFocus()
  2.   YourComboBox.Dropdown
  3. End Sub 
  4.  
will drop down the list, showing the user, as they type, the names that are close to what they've typed, and if they have a complete cranial meltdown, they can always scroll thru the items looking for the report they need.

Welcome to TheScripts, dponce!

Linq ;0)>
Feb 2 '08 #9

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

Similar topics

7
14370
by: Pat | last post by:
I would like to send the Print Preview of a MS Access form to a Snapshot file. The form contains an OLE graph. BACKGROUND A snapshot of a report is possible. If I could I would use a report to display the graph but it is not possible to send query parameters to an OLE graph on a report (or programatically change any properties of an OLE Graph). However with a Form you do have the ability to change the RowSource of
9
3077
by: Colin McGuire | last post by:
Hi, I have an report in Microsoft Access and it displays everything in the table. One column called "DECISION" in the table has either 1,2, or 3 in it. On my report it displays 1, 2, or 3. I want to appear in the report is Yes, No, or Maybe. What do I need to do to change what appears in the report/what term do I need to search out in Google? Thank you Colin
14
2469
by: Crimsonwingz | last post by:
Need to calculate a sum based on a number of factors over a period of years. I can use formula ^x for some of it, but need totals to carry over in the sum and have only been able to do this thus far with a loop in a form. Basically, I have key sums Current savings Current Salary Current deposit amount
2
14132
by: Dean Slindee | last post by:
Anybody written code in VB.NET to: 1) show a print preview window of reports already written and stored in an Access 2002 database; or 2) execute the print of a report stored in an Access 2002 database? Thanks, Dean Slindee
2
4020
by: Lars Netzel | last post by:
Is it hard to make a Print button from a Windows Form that will print a number of fields from an Access database in a fairly formatted way? How does this work with the Print Dialoges and stuff? I do NOT want to involve Crystal Reports! Been there and never want to do it again. :) /Lars
6
4903
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of the html page controls the form fields that are required. It doesn't function like it's supposed to and I can leave all the fields blank and it still submits the form. Also I can't get it to transfer the file in the upload section. The file name...
8
6389
by: jbonifacejr | last post by:
This is my first day here, so please be patient. I do not know how to search very well so the search I tried to get the answer showed me topics from the year 2000 and they really don't cover what I want. I am trying to open MSAccess from ASP..I guess I would use server.createobject("Access.Application") OK, but where do i go from there to run a report and have it print to the default printer?
1
9558
by: hasanainf | last post by:
Hi all and thanking you all in advance for your help My client wants to use a receipt printer. Since I have never used one before I have some questions. 1. Unlike other printers which are set by default to print a whole A4 size page, I want the receipt printer to print an unlimited lenght of receipt, that is to say that if five items are sold, the receipt printer should print company details with five items and a total figure and stop...
16
6537
by: JoeW | last post by:
I'm utilizing a database that I created within MS Access within a program I've created in VB.NET. I am using the VB front end to navigate the information, but want to be able to print a report, that I've also created within MS Access. I've attempted using the Access.Application instance, but I get errors when it tries to load the database. Just wondering if anyone has any experience with this, and what I should do. Thanks for any...
1
2495
by: sonicfun2006 | last post by:
I have SQL Server Database and MS Access 2003 is connected with ODBC. I have very large amount of records in various tables. The database is very dynamic as it changes every minute. I’m trying to have a live MS Access report which would pull data from SQL Server. I’ll try to explain how I’m trying do this: The Access report should have two parts: 1. Title page report, just like table of contents. It should be listing a particular field of a...
0
9647
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...
1
10100
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9959
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8988
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
7509
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
6744
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
5396
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5528
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2893
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.