Solved

Problem Passing a Report Parameter In Access 2010 Database

Posted on 2016-08-11
3
58 Views
Last Modified: 2016-08-11
I have an Access 2010 database that I am using as a test to Store Historical Maintenance records  for different pieces of machinery. I am looking at producing a report for each machine. I was looking at passing a parameter to the report for a particular machine which would then display all the records for that particular machine.

The database comprises  5 tables:

4 of the tables are for storing details of the service job to save the operator having to type them in each time -
i.e.

tblElement - populated by frmNewElement form

tblMachine - populated by frmNewMachine  form

tblTasks - populated by frmNewTasks  form

tblManufacturer

The 5th Table -  tblHistory - populated by the frmMaintenance  form is the one that stores the records that I am trying to report from. I have set up qryHistory query which allows me to pass a date parameter to the MaintenanceHistoryByDate Report which works OK.

However, I have tried several ways to create a query that would allow me too pass a Machine name parameter to another report I have created -   Maintenance Schedule  but it either returns nothing or the debug screen launches.

I have attached the test database with 5 dummy records to view
TPMScheme11.accdb
0
Comment
Question by:rabpwh1000
  • 2
3 Comments
 
LVL 35

Accepted Solution

by:
PatHartman earned 500 total points
ID: 41752406
I added a new form to run the reports.  Using prompts in the queries is annoying for reports since you will be prompted multiple times.  The OpenReport method allows a where argument to be passed and that is what i did.  I also added validation which you may or may not want but if you don't want to require the arguments, you will need to change the procedure to eliminate the where argument if no argument is provided.
TPMScheme11Fixed.accdb
0
 

Author Closing Comment

by:rabpwh1000
ID: 41752445
Thanks Pat I have been trying to get this done for days now
0
 
LVL 35

Expert Comment

by:PatHartman
ID: 41752450
You're welcome.  Hope you can understand how to expand the process as you add new reports and variables.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question