Discussion Locked

Using input query values again

0 helpful
9 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi,

I've got a button that opens a form.
That form is populated by a query that
requires the user to enter two dates.

I've also got a button on the new form
that opens a report using the same query.

Is there a way that I can use the results
from the first query so the user doesn't
have to enter the two dates again to
view the report?

Thanks,

Craig Shepherd
TransACT Communications
craig.shepherd@transact.com.au

9 replies

by craig shepherd

I've already got the dialog boxes. I want to know how I can
use the results in a report after the form has already been
populated.

by miss kitty

For example, form1 has fromdate and todate that the user enters. On form2 reference form1.fromdate and form1.todate. There's not need to make it anymore complicated.

Cathy

by craig shepherd

That does complicate it though. At the moment the form's datasource is a query. The query is what's asking the two dates, not the form. When I open another form from the original, I want to use the same dates. How?

by pnakiet

Hi, Craig Shepherd
I don't know what programming language you use. But through your question, I think you use Access, don't you?
If you use Access, you are able reference to Form control from query that use as RECORDSOURCE of form or report by syntax below to deliminate the prompt dialog box:

SELECT *
FROM query1 (table1)
WHERE fromDate >= CDATE('" &
FORMS!FORM1!FROMDATE.TEXT & "') AND todate <= CDATE('" &
FORMS!FORM1!TODATE.TEXT & "')"

The name of form you want to open another form or report: FORM1

Have succeed

PNAKiet

by richtee

One way to handle this situation would be to put two text fields on your original form for the date entries.

Set the parameter of the query to the two date fields on the original form.

You will only have to enter the dates once.

Contact me if you need more detail on how to do this.

Good Luck, Rich

This discussion is closed to new replies.