Patrick -
When you run the reports, is the form open? If not, open it before running
the reports.
Also, are you using any cross-tab queries in your reports? They have issues
with some parameters which require you to define the fieldtype within the
queries with the parameters (even though you are pulling the data from a
form, you can define these as parameters, e.g.
[forms]![frmreportform]![startmonth] can be a parameter name.
Just to clarify. If the form is open, you can run the query that contains
the parameters with no problem. Can you run the query that is in the
subreport without a problem (the one based on the initial query)? The report
itself never runs without asking for the parameters, even if the form is open?
--
Daryl S
Patrick Hatton said:
Daryl,
My apologies, I am using the term code too loosely. There is code that runs
a report. The report is made up of 8 sub-reports. The sub-report control
source is a query that uses another query that tries to pull dates from an
open form. When the query is run during the report process it will prompt
for data vs running the query manually.
:
Patrick -
Can you post the statement for running the query?
--
Daryl S
:
Yes, the form is open when running.
The query is using: Between [forms]![frmreportform]![startmonth] And
[forms]![frmreportform]![endmonth]
This is the strange part. I can run the query with the form closed, no data.
Open the form, run the query, works fine. When this same thing is done from
the code, it doesn't work.
:
Patrick -
Is the form open when you are trying to just run it through the code? If
not, then open the form first. You can make the form inivisible if you don't
want the users to see it.
--
Daryl S
:
I have a routine that uses data from a form. Each time I run it, it asks for
input on any field contained in the form.
If I open the form then manually run the query it works fine. When I let it
run throught the code, it cannot see the fields.
Your suggestions are greatly appreciated.
Patrick