473,394 Members | 1,371 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,394 software developers and data experts.

Sending Parameters to Query

For a query that has two parameters for a start and end date, is it
possible to send the parameters values when the query is used by a
report instead of prompting the user?
I do not want to add the [forms]![myform]![mycontrol] in to the query
as it then makes the query useable from only that one form.

Nov 13 '05 #1
2 1478
Well there are options of course.
<Battens down the hatches>

You *could* use global variables and have a function pull the value as the
criteria for your query (wherever it may be opened from). (Not particularly
my preference I hasten to add)

Or perhaps just have a local table that holds criteria for you (dates too
and other criteria ranges perhaps) and retrieve those values in your WHERE
clause. Set those values before opening whatever form or report you wish
and yer off.

Any use?

<ro*******@hotmail.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
For a query that has two parameters for a start and end date, is it
possible to send the parameters values when the query is used by a
report instead of prompting the user?
I do not want to add the [forms]![myform]![mycontrol] in to the query
as it then makes the query useable from only that one form.

Nov 13 '05 #2
<ro*******@hotmail.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
For a query that has two parameters for a start and end date, is it
possible to send the parameters values when the query is used by a
report instead of prompting the user?
I do not want to add the [forms]![myform]![mycontrol] in to the query
as it then makes the query useable from only that one form.

Have you looked at the arguments for DoCmd.OpenReport? You can specify a
filter so it only shows relavant records. This is OK as long as you provide
your users forms and buttons to open the report and do not simply let them
open it from the database window.
Another option is to base the report on a query and re-write the definition
of the query (qdf.SQL) each time. Again - this is for when you write the
UI.
Nov 13 '05 #3

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

Similar topics

4
by: Bruce Duncan | last post by:
I'm new to PHP...and my previous post was a bit premature. I've narrowed my problem down to this: I have this very simple form in test1.php <form name='formx6' action="testz.php?varxy=1">...
5
by: Bruno Alexandre | last post by:
Hi guys, withou using SP, I want to be able to add a Parameter to the SQL Query and retrive the Recordset so I can use the Paging property under the recorset object.... how can I do this? I'm...
0
by: Omavlana | last post by:
Hi, pls clarify these 2 questions. 1. How can I send some values of globla variables from VB.NET to crystal report. I want to show these values on report. 2. I have added an SQL query in my...
1
by: Zaidan | last post by:
I am running Excel2000 under WIN98 2nd edition, and I am writing a VBA code (I will consider using javascript if I have to) that does the following, at the user command: 1- Start MS Explorer and...
3
by: Ryan Hubbard | last post by:
I would like to run a query from VBA. The query will be one with parameters. Is there a way to run the query and have Access prompt for the values like it does if I where to execute it through...
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...
0
by: Zlatko Matić | last post by:
Hi everybody! Recently I was struggling with client/server issues in MS Access/PostgreSQL combination. Although Access is intuitive and easy to use desktop database solution, many problems...
5
by: billelev | last post by:
Hi There, I am trying to execute a query using openRecordset on a query called 'AccountValues'. The 'AccountValues' query relies on another query, 'Prices', which in turn relies on a form for two...
2
by: Vesper | last post by:
Hi, I am trying to create an ASP file which will search Multiple Values in a Database. Everything is fine if there is one parameter but if there are more I receive an SQL error message: ...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...

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.