473,386 Members | 1,652 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.

How to set query parameters from VBA

I am running Access 2002. I have some reports I would like to be able to
run from VBA or interactively. The reports use queries with parameters.
When the user runs the report, the parameter prompts for the query are
displayed, and the user fills them in. What I would like to do is set
those parameter values from VBA when running the reports. Is there a way
to do that?

Thanks in advance,

amorphous
Aug 16 '06 #1
4 5486
I would think it would be easier to remove the parameters from the
queries you're using and then just pass a valid Where clause in the
open event of the report. Then you can build whatever filters you want
and reuse the report more easily. bit that's just my opinion.

Aug 16 '06 #2
On 16 Aug 2006 03:16:56 GMT, amorphous999 <jf**********@MAPSON.com>
wrote:

Not entirely sure what you mean, but I have been experimenting with
Criteria forms launched as Modal forms in the Report_Open event; just
in time for setting Me.RecordSource.

-Tom.

>I am running Access 2002. I have some reports I would like to be able to
run from VBA or interactively. The reports use queries with parameters.
When the user runs the report, the parameter prompts for the query are
displayed, and the user fills them in. What I would like to do is set
those parameter values from VBA when running the reports. Is there a way
to do that?

Thanks in advance,

amorphous
Aug 16 '06 #3
In article <Xn**********************************@216.165.192. 91>,
jf**********@MAPSON.com says...
I am running Access 2002. I have some reports I would like to be able to
run from VBA or interactively. The reports use queries with parameters.
When the user runs the report, the parameter prompts for the query are
displayed, and the user fills them in. What I would like to do is set
those parameter values from VBA when running the reports. Is there a way
to do that?

Thanks in advance,

amorphous
You might google groups for: Ken Sheridan parameter query every report

It may be of some help.
Aug 16 '06 #4
pi********@hotmail.com wrote in news:1155700842.369166.142880
@m73g2000cwd.googlegroups.com:
I would think it would be easier to remove the parameters from the
queries you're using and then just pass a valid Where clause in the
open event of the report. Then you can build whatever filters you want
and reuse the report more easily. bit that's just my opinion.
basically, i can't do that. the problem is that the report pulls and
groups data from two sources using 2 different queries (call them Qry1 and
Qry2). A third query QryR, joins the results of Qry1 and Qry2 together and
is the recordsource of the report. The filtering criteria I currently
specify in the parameters has to be applied to Qry1 and Qry2 rather than
QryR. That's why I'd like to set query parameters from VBA code.

amorphous
Aug 17 '06 #5

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

Similar topics

1
by: longtim | last post by:
I have been having endless difficulty creating reports/queries that set any relevent parameters from controls in forms. I am creating an application under access 2003 but will target access...
0
by: Amelyan | last post by:
Root > Parent > Current Can sitemap control loaded from Web.sitemap be enabled to automatically maintain query parameters of previous node? E.g. when user clicks Parent, instead of just...
5
by: ric_deez | last post by:
Hi there, I would like to create a simple search form to allow users to search for a job number based on a number of parameters. I think I understand how to use parameteres associated with Stored...
12
by: Carlos555 | last post by:
I've got a question regarding query parameters: I am trying to filter the master data for items whivh have a specific text sting at the end. I was experimenting with using 'Right(,5)' as part...
6
by: sunil | last post by:
I have a button named Button1, and I wrote an event handler for the OnClick event. protected void Button1_Click(object sender, System.EventArgs e) { this.Response.Redirect("Default.aspx?q=" +...
5
by: dana1 | last post by:
Hello Experts! Does anyone know if there is a way to set the values of query parameters from VBA for a report's recordsource? (i.e., I want to set the values of the parameters and NOT have the...
3
hyperpau
by: hyperpau | last post by:
Hi there guys! I have a Form where there are three comboboxes. This comboboxes are used as references for the parameter of 3 fields in a query. when I hit a command button in my form, it opens...
17
by: NeoAlchemy | last post by:
I am starting to find more web pages that are using a query parameters after the JavaScript file. Example can be found at www.opensourcefood.com. Within the source you'll see: <script...
2
by: raaman rai | last post by:
i have 3 drop dropdown box which is used for searching my database. Either one of them can be selected to perform the search but if none of them is selected it will give an error. Well in reference...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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.