how to reference query parameters in forms

  • Thread starter Thread starter Kestone
  • Start date Start date
K

Kestone

Hello,
I am working on an inventory tracking and forecasting
database. I have a parameter query that specifies a first
and last date to give the number of mailings and qty of
listed components for a particular package. I created a
report to display the results but now I and building a
form to display the results and hopefully rerun/refresh
results by entering new parameter dates. My problems are
1) how do I get the parameter dats to display on my form
and 2) how do I update them from in the for to rerun the
query? Does anyone have any ideas on how I can make this
work?

Thanks,
Kevstone
 
Hi,

I think this may be what you are looking for.

Add two unbound text fields to your form. Call them
FistDate and LastDate

Leave your form open, just minimise it, as this makes the
next bit easier.

Open your query in design view.

In the columns you wish to query (i.e. where you
previously had your parameters) right click in the
criteria row, and select 'Build' from the drop down list.

This will display the Expression Builder window.



At the bottom you will see three columns, in the first
column, double click on Forms, then double click on
Loaded forms, then just click on the form in question.

Then in the second column double click on 'FirstDate',
this will move the whole path to the top window, repeat
for 'LastDate'

You will get something like the following:

Forms![FormName]![FirstDate] «Expr» Forms![FormName]!
[LastDate]

Delete <<Expr>> and add the Between and And words as per
below

Between Forms![FormName]![FirstDate] And Forms![FormName]!
[LastDate]

Click on OK when ready, this will transfer the expression
to your query.

Now you will just need to add a command button to your
form to run the query.

Hope this helps

julie
www.simply-access.com

Then in the second column
 
Back
Top