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
-
Perplexity Pro free for 12 mos for Samsung Galaxy phones
by
Patricia Grace
6 hours, 49 minutes ago -
June KB5060842 update broke DHCP server service
by
Alex5723
5 hours, 21 minutes ago -
AMD Ryzen™ Chipset Driver Release Notes 7.06.02.123
by
Alex5723
9 hours, 23 minutes ago -
Excessive security alerts
by
WSSebastian42
5 hours, 4 minutes ago -
* CrystalDiskMark may shorten SSD/USB Memory life
by
Alex5723
18 hours, 51 minutes ago -
Ben’s excellent adventure with Linux
by
Ben Myers
52 minutes ago -
Seconds are back in Windows 10!
by
Susan Bradley
6 hours ago -
WebBrowserPassView — Take inventory of your stored passwords
by
Deanna McElveen
15 hours, 55 minutes ago -
OS news from WWDC 2025
by
Will Fastie
20 hours, 6 minutes ago -
Need help with graphics…
by
WSBatBytes
3 hours, 22 minutes ago -
AMD : Out of Bounds (OOB) read vulnerability in TPM 2.0 CVE-2025-2884
by
Alex5723
1 day, 10 hours ago -
Totally remove or disable BitLocker
by
CWBillow
9 hours, 27 minutes ago -
Windows 10 gets 6 years of ESU?
by
n0ads
12 hours, 42 minutes ago -
Apple, Google stores still offer China-based VPNs, report says
by
Nibbled To Death By Ducks
1 day, 21 hours ago -
Search Forums only bring up my posts?
by
Deo
50 minutes ago -
Windows Spotlight broken on Enterprise and Pro for Workstations?
by
steeviebops
2 days, 8 hours ago -
Denmark wants to dump Microsoft for Linux + LibreOffice
by
Alex5723
2 days, 1 hour ago -
How to get Microsoft Defender to honor Group Policy Setting
by
Ralph
2 days, 9 hours ago -
Apple : Paragon’s iOS Mercenary Spyware Finds Journalists Target
by
Alex5723
2 days, 19 hours ago -
Music : The Rose Room – It’s Been A Long, Long Time album
by
Alex5723
2 days, 20 hours ago -
Disengage Bitlocker
by
CWBillow
2 days, 10 hours ago -
Mac Mini M2 Service Program for No Power Issue
by
Alex5723
2 days, 22 hours ago -
New Win 11 Pro Geekom Setup questions
by
Deo
44 minutes ago -
Windows 11 Insider Preview build 26200.5651 released to DEV
by
joep517
3 days, 5 hours ago -
Windows 11 Insider Preview build 26120.4441 (24H2) released to BETA
by
joep517
3 days, 5 hours ago -
iOS 26,, MacOS 26 : Create your own AI chatbot
by
Alex5723
3 days, 9 hours ago -
New PC transfer program recommendations?
by
DaveBoston
1 day, 14 hours ago -
Windows 11 Insider Preview Build 22631.5545 (23H2) released to Release Preview
by
joep517
3 days, 13 hours ago -
Windows 10 Build 19045.6029 (22H2) to Release Preview Channel
by
joep517
3 days, 13 hours ago -
Best tools for upgrading a Windows 10 to an 11
by
Susan Bradley
3 days, 2 hours ago
Recent blog posts
- Ben’s excellent adventure with Linux
- Seconds are back in Windows 10!
- WebBrowserPassView — Take inventory of your stored passwords
- OS news from WWDC 2025
- Best tools for upgrading a Windows 10 to an 11
- Master patch listing for June 10, 2025
- 24H2 may not be offered June updates
- June 2025 updates are out
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.