Solved

Problem Passing a Report Parameter In Access 2010 Database

Posted on 2016-08-11
3
53 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

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
When I recently replaced my image transfer kit on my office HP color laserjet 5550dn printer, I had a slight problem.  The left bracket that holds the transfer kit got stuck in the upright locked position instead of being at a 45 degree angle facing…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

770 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