Display query selection in Form

A

Andnor

I have created a form that displays the results of a query. I have used
the function "Between [Date1] and [Date2]" in the criteria section of
the query for Field:Date. I am trying to get the Form to display what
they chose for Date1 and Date2. I am not very accomplished in Access
so specifics would be appreciated. Thank you in advance for your help.
 
J

John Vinson

I have created a form that displays the results of a query. I have used
the function "Between [Date1] and [Date2]" in the criteria section of
the query for Field:Date. I am trying to get the Form to display what
they chose for Date1 and Date2. I am not very accomplished in Access
so specifics would be appreciated. Thank you in advance for your help.

I'd suggest turning this around: rather than displaying what the user
responded to the prompt, get the parameters from the form directly.
Put two unbound textboxes, txtFrom and txtTo say, directly on the
Form; in the query's criteria use

BETWEEN [Forms]![YourFormName]![txtFrom] AND
[Forms]![YourFormName]![txtTo]


John W. Vinson[MVP]
 
A

Andnor

John said:
-

I have created a form that displays the results of a query. I have
used
the function "Between [Date1] and [Date2]" in the criteria section of
the query for Field:Date. I am trying to get the Form to display what
they chose for Date1 and Date2. I am not very accomplished in Access
so specifics would be appreciated. Thank you in advance for your
help.-

I'd suggest turning this around: rather than displaying what the user
responded to the prompt, get the parameters from the form directly.
Put two unbound textboxes, txtFrom and txtTo say, directly on the
Form; in the query's criteria use

BETWEEN [Forms]![YourFormName]![txtFrom] AND
[Forms]![YourFormName]![txtTo]


John W. Vinson[MVP]


Thanks for your help John. I should have mentioned earlier that the
query uses totals and in order for the query to work I had to, in the
Total section of the query, use "where" and deselect the Show: checkbox
for date. I suppose that because it is not selected that Date does not
show up in the control source. Also, if I am able to create a text box
for the date parameters how would I make the Form update with the
numbers entered in the Form? Thanks again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top