473,320 Members | 1,909 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,320 software developers and data experts.

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

14
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 1742
ADezii
8,834 Expert 8TB
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
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
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 Expert 8TB
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,556 Expert Mod 16PB
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 Expert 8TB
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,556 Expert Mod 16PB
;) No Probs ADezii.
I fall over the same sorts of thing myself quite often.
Feb 2 '08 #8
missinglinq
3,532 Expert 2GB
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
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...
9
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...
14
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...
2
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...
2
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? ...
6
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...
8
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...
1
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...
16
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,...
1
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...
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: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
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)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.