Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Single form for different Reports
H 

16 years ago
Hi there, I have several reports that require a date range so I created a form with all the available reports and once a user click on a report, then another form appears that allows the user to enter the date range. This data range form has a 'Print' and 'Print Preview' build button. how can I make this buttons to recognize which report the user is selecting the date criteria for? (when I started this database it was only for one report, therefore the 'Print and PrintPreview' buttons were coded for that specific report) but this is not the case any more.

Thank you for your help
 


Answer from Richard Rost:

Here's what I would do…

Make a combo box that contains all of the names of your reports. You can have two columns - one for the system name of the report "AccountsPayableR" and the english name "Accounts Payable" that's visible - if you want.

Now, make two TEXT boxes on your form. One for start date, the other for end date.

Now, make a command button that launches the report based on the combo box:

Docmd.OpenReport ComboBoxValue…

For the reports that are date sensitive, have them pull the dates from your form:

=Forms!FormName!StartDate

See this tutorial for more help:

If you want to refer to a value on a Form, you can use the notation:

Forms!FormName!FieldName

You can use this notation inside of queries, other forms, or even reports. I have a free tutorial that explains how to use this:

http://599cd.com/tips/access/forms-formname-field-notation?key=BlFAlEx

Note that if you're refering to a value on a SUBFORM, the correct notation is:

Forms!FormName!SubForm.Form!FieldName

Crazy, I know. Enjoy! Hope this helps.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/31/2026 9:13:57 PM. PLT: 1s