Is this possible?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Okay, I have a query that is working great, thanks to this forum. Here's my
next
question:
The query has a Date field which I have an expression asking for a specific
date
range. That works. Now can I have a new field which will tell me what that
date
range is, so I can place the new field on a form ?
I thought I would put a label "Between" a txtfield label "And" txtfield.
In the txtfield it would put the date range.
 
If I understand your situation, you are trying to use a parameter query to
generate a value on a form. That seems backwards to me. What you will
encounter in this 'group more often is using a form to "collect" the values,
then running a query with the criteria pointing back at the controls on the
form.

Or have I completely missed your point?
 
I may not have mady myself clear. I have a query that selects my records for
a given date range. No problem. What I want is to place some sort of label
that will indicate the date range for those records on a form so user will
see the words
"Date Range Between 'start date' and 'end date' with the actual dates
for start and end date.
 
No, I believe I understood what you are trying to do. It's just that using
that approach seems somewhat turned about. If you have to enter the
start/end dates someplace in order for the query to run, then why not enter
them in the form in which you want the records and date range to be
displayed?

There is, as far as I know, no way to "pass" parameters from a query to a
form. But there is a simple way to pass parameters from a form to a query.
If you change the criteria of your parameterized query to read something
like:

Between Forms!YourForm!YourStartDate And Forms!YourForm!YourEndDate

and only run the query when the form is opened and the controls filled with
start/end date values, it seems like this gives you what you were after:
a form with the begin/end dates
a query that uses those dates as selection criteria
a form that displays the records returned by the query, based on the
selection criteria
 
Thanks, I'll give that a try. Now I'm not sure if I asked this in another
forum, however, I need to have 5 different queries' results show up on one
form. They are the same fields, but different date selections. Any
suggestions, other than to tell boss 'no can do'!
 
Could you provide a bit more description? For instance, where do the
"different date selections" come from? How many records are you retrieving
at a time, when you do all five queries?

Since you are retrieving the same fields, consider using a UNION query (see
Access HELP) to combine your five queries' results. Then show the UNION
query (results) on the form.
 
Back
Top