Hi. I am a newbie. I have a database with multiple reports and I would like to create a form with list of these reports you can click on one in the list and then click preview or print to print that report. I have looked at the Northwind Database example which has a Sales by Category Detail which is what I want but I can not figure out how it gets it’s information and how to make it work. Please help I am stumped. Than you in advance for any help you can give.
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Access Forms (2000)
Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Access Forms (2000)
- This topic has 11 replies, 5 voices, and was last updated 23 years, 5 months ago.
AuthorTopicWSNeil82591
AskWoody LoungerJanuary 17, 2002 at 4:23 pm #365541Viewing 1 reply threadAuthorReplies-
WSbushaw
AskWoody LoungerJanuary 17, 2002 at 4:57 pm #564410Here’s a basic outline of one approach (reply back if you need more detail):
1. Create a table which includes your report names (this table could be populated by inspecting the CurrentDb().Containers(“Forms”).Documents collection — if you’re familiar with VBA and navigating the object model — otherwise, just fill in the table by hand).
2. Create a form that uses this table as its Record Source. Include a text control that references the table’s report name field.
3. On this form create a “Preview” button. As its OnClick event, specify the following command:
DoCmd.OpenReport Me!txtReportName, acViewPreview
(txtReportName is the Name for the text control on the form that displays the selected report name).
4. Create a similar “Print” button with a simiar OnClick event, but specify acViewNormal instead of acViewPreview
I think something like that would get you what you want. I’ve left out the gory details. If you need them, holler.
-
WSNeil82591
AskWoody LoungerJanuary 17, 2002 at 6:35 pm #564437I think I must not be too smart because I am lost……LOL. I have a table I created with 2 fields first one is report second is report name. I typed in the Report in the first field but what do I put in the second. Second… I have the list box on my form and a preview and print button but when I created the buttons they attached themselves to a specific report HELP! Thanks.
-
WSrhconley
AskWoody LoungerJanuary 17, 2002 at 7:21 pm #564453I think you’re confused. First, you create all of your reports. Next, create a form and, as Mr. Swanson so expertly advised, add 1 control button to the form for each report. Finally, ‘program’ each button with the code Mr. Swanson supplied, replacing ‘Report Name’ with the actual name of the report. To access the Code Builder for each control button, highlight the button (not the label), right click on the button, select ‘Build Event…’, select ‘Code Builder’, and paste Mr. Swanson’s code in, make sure you specify the correct report name. You should be good to go.
I’m not sure what you’re trying to do with the table you created.
-
WSNeil82591
AskWoody LoungerJanuary 17, 2002 at 7:56 pm #564471 -
WSGARYPSWANSON
AskWoody LoungerJanuary 17, 2002 at 9:16 pm #564497It sounds as if you are looking for Tom’s method. Tom is creating a listbox that links to a table with your report names.
First, create a table with the names of the reports. The table can have two fields, ID (use autonumber and set as primary key) and name (set as text, size as needed to store the report name) Input the report names in the table such that the report name in the table matches the report name object (i.e, include spaces, commas, etc).
Create the listbox (use the wizard, its easier) and connect to the table so it gets the data for the listbox from the table. Thus, when using the listbox, you will be able to select the name of the report you want.
Then follow the rest of Toms’ directions. This is not as fancy as the Northwinds database, but it works.
Good Luck
-
WSNeil82591
AskWoody LoungerJanuary 17, 2002 at 9:23 pm #564500Thanks. I got that far to set up the List box and it is using the table but I didn’t understand the rest of the directions that TOM gave me. I guess I don’t know half of what I thought I knew about access. Can you please explain in more detail the rest of the process? Thank you again for bearing with a newbie.
-
WSNeil82591
AskWoody Lounger -
WSrory
AskWoody LoungerJanuary 18, 2002 at 1:42 pm #564636Hi,
This may be too late, but if you want a dynamic list of reports (i.e. not having to add new reports to your table as you create them) you can set your listbox row source to:
SELECT Name from MSysObjects WHERE Type = -32764
and this will then pick up ALL reports in your database. This does have the disadvantage that it will include any subreports in your database, but it’s less effort to maintain!
Hope that helps. -
WSGARYPSWANSON
AskWoody Lounger -
WSbushaw
AskWoody LoungerJanuary 18, 2002 at 2:18 pm #564642Neil,
Glad you got it figured out. Sorry I didn’t check back sooner to see if you needed more help. Obviously there’s lots of help here in the Lounge, ready and waiting! I knew I had left lots of gaps in my suggestion — sometimes you learn more by figuring things out rather than following a recipe, right? Frustrating at times, sure, but more satisfying in the end.
You might try Rory’s suggestion for “populating” your list box. Rather clever, I think. It keeps the list up to date as you add or remove reports or change report names, and it doesn’t require a separate table. I was trying to figure out a way of doing that but was unsuccessful. If you want to exclude certain reports (e.g., subreports as Rory mentions or other reports used for other purposes), just name your reports in a clever way. For example, begin the names of the ones you want to include with something like “List”, then add the following filter to Rory’s query:
SELECT Name from MSysObjects WHERE Type = -32764 AND Left(Name,4)=”List”;
Good luck.
-
-
-
-
WSGARYPSWANSON
AskWoody LoungerJanuary 17, 2002 at 5:03 pm #564412… Another option is to create a form with checkboxes, one for each report. Put the report name next to the checkbox as text for the user to reference. Then build an event for each checkbox that will open the report whenever the checkbox is checked. See Below:
Private Sub Check94_Click()
If Forms!FormName!Check94.Value = True Then
stDocName = “ReportName”
DoCmd.OpenReport stDocName, acPreview
End IfEnd Sub
… Or you could create a preview button that opens all reports checked using the same logic.
Good luck.Viewing 1 reply thread -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Windows 11 Insider Preview Build 26100.4482 (24H2) released to Release Preview
by
joep517
2 hours, 20 minutes ago -
Windows 11 Insider Preview build 27881 released to Canary
by
joep517
2 hours, 22 minutes ago -
Very Quarrelsome Taskbar!
by
CWBillow
12 hours, 34 minutes ago -
Move OneNote Notebook OFF OneDrive and make it local
by
CWBillow
15 hours, 19 minutes ago -
Microsoft 365 to block file access via legacy auth protocols by default
by
Alex5723
4 hours, 4 minutes ago -
Is your battery draining?
by
Susan Bradley
3 hours, 59 minutes ago -
The 16-billion-record data breach that no one’s ever heard of
by
Alex5723
3 hours, 54 minutes ago -
Weasel Words Rule Too Many Data Breach Notifications
by
Nibbled To Death By Ducks
19 hours, 10 minutes ago -
Windows Command Prompt and Powershell will not open as Administrator
by
Gordski
3 hours, 16 minutes ago -
Intel Management Engine (Intel ME) Security Issue
by
PL1
3 hours, 28 minutes ago -
Old Geek Forced to Update. Buy a Win 11 PC? Yikes! How do I cope?
by
RonE22
38 minutes ago -
National scam day
by
Susan Bradley
3 hours ago -
macOS Tahoe 26 the end of the road for Intel Macs, OCLP, Hackintosh
by
Alex5723
5 hours, 17 minutes ago -
Cyberattack on some Washington Post journalists’ email accounts
by
Bob99
1 day, 20 hours ago -
Tools to support internet discussions
by
Kathy Stevens
8 hours, 55 minutes ago -
How get Group Policy to allow specific Driver to download?
by
Tex265
1 day, 11 hours ago -
AI is good sometimes
by
Susan Bradley
2 days, 3 hours ago -
Mozilla quietly tests Perplexity AI as a New Firefox Search Option
by
Alex5723
1 day, 17 hours ago -
Perplexity Pro free for 12 mos for Samsung Galaxy phones
by
Patricia Grace
3 days, 3 hours ago -
June KB5060842 update broke DHCP server service
by
Alex5723
3 days, 2 hours ago -
AMD Ryzen™ Chipset Driver Release Notes 7.06.02.123
by
Alex5723
3 days, 6 hours ago -
Excessive security alerts
by
WSSebastian42
1 day, 21 hours ago -
* CrystalDiskMark may shorten SSD/USB Memory life
by
Alex5723
3 days, 15 hours ago -
Ben’s excellent adventure with Linux
by
Ben Myers
5 hours, 59 minutes ago -
Seconds are back in Windows 10!
by
Susan Bradley
3 days, 2 hours ago -
WebBrowserPassView — Take inventory of your stored passwords
by
Deanna McElveen
1 day, 20 hours ago -
OS news from WWDC 2025
by
Will Fastie
1 day, 6 hours ago -
Need help with graphics…
by
WSBatBytes
2 days, 11 hours ago -
AMD : Out of Bounds (OOB) read vulnerability in TPM 2.0 CVE-2025-2884
by
Alex5723
4 days, 7 hours ago -
Totally remove or disable BitLocker
by
CWBillow
3 days, 6 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.