473,386 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Pass Parameter to query via Report

Anyone know how to pass a parameter to a query via a report in Access
2003?

Jan 30 '06 #1
2 6357
If you are going to enter it manually, make it a parameter query and when
the report runs it will ask for the parameter. Will work for multiple
parameters but will pop up a dialog asking for each in turn.

Or you could build a dialog on which you enter the value/s, hide the form
only when showing the report, don't unload it, and have your report query
reference the controls on the dialog to get the value. This solution is good
if you have multiple parameters.

Then in the close event of the report check to see if the dialog is open,
which it should be, then close it.

If there is to be no human entering of the parameter, use a constructed
'where' statement to filter the report.

There are other ways of doing this but this is the method I see used often.
I rarely use it myself as I have built a reporting module that handles
pre-processing, filter dialogs and much more.

Jeff

"Roger" <ro************@gmail.com> wrote in message
news:11*********************@g14g2000cwa.googlegro ups.com...
Anyone know how to pass a parameter to a query via a report in Access
2003?

Jan 30 '06 #2
I agree the easiest way is to use a where clause to filter the report.
(have the report's filter on property set to yes)

This is best done though if you are using

Docmd.openreport..... to open the report

Alternatively - if using Access2003 you can pass openargs now to a
report so in the on open event you can use these to modify the report's
recordsource. You can also modify the recordsource in the on open
event by referencing other objects (eg form, table ....) for criteria.

Jan 30 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Corey | last post by:
All, I am relatively new to XML and I have what may sound like a dumb question. I want to pass a query string variable to my xml document and filter the output based on that variable. For...
5
by: Don Seckler | last post by:
I have an update query that runs when a report closes. I have several reports that will need to run the update query with diferent criteria. I'd like to simply make the criteria change in the...
4
by: Andy Davis | last post by:
I have developed a number of reports that are based on parameter queries where the user enters criteria such as a date range and a sales rep say. I want to be able to show a graphical picture in...
7
by: Zlatko Matić | last post by:
Let's assume that we have a database on some SQL server (let it be MS SQL Server) and that we want to execute some parameterized query as a pass.through query. How can we pass parameters to the...
1
by: Ray | last post by:
Dear all, How to pass parameter from vb.net to Crystal Report? I'm now using ReportDocument and CrystalReportViewer. However, I don't know how to pass a parameter to the report and print the...
6
by: tizmagik | last post by:
I am having a lot of difficulty generating a CrossTab Query based report. I have looked online for several tutorials and whatnot but I have not been able to really find what I'm looking for, nor...
1
by: Mayhem05 | last post by:
I have an Access 2003 database that I need to write some VBA code for to populate a table. The table is based on a query I have built in Access queries. Right now I have 2 parameters that are...
3
by: jtrapat1 | last post by:
Im using sql server 2005 and visual studio 2005. I just want to create some reports and deploy them to the local reportserver for an intranet application by using reporting services. I'd like to...
8
by: DanicaDear | last post by:
I have something interesting...looking to see if anyone else has came across this. I have a query with parameter and and the query works beautifully every time. However, when I use the wizard...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.