keeps asking for parameters

  • Thread starter Thread starter nydia
  • Start date Start date
N

nydia

background: i created a database to keep track of clients
and when they attended meetings. i want to create a
billing sheet(invoie), so that i can submit to clients.
THere are 2 types of meetings, group and individual.

I have 2 queries that i created reports based on. qry 1
has clients name, address, programname, date started,
terminated date(isnull). 2ndquery has meeting date(used
parameter between[start]and[end]), duration of meeting etc.

when i run the query it works fine, but when i open the
report, it will prompt me like 5 times for the start and
end date before it opens the report, why??? any help is
greatly appreciated.
 
nydia said:
background: i created a database to keep track of clients
and when they attended meetings. i want to create a
billing sheet(invoie), so that i can submit to clients.
THere are 2 types of meetings, group and individual.

I have 2 queries that i created reports based on. qry 1
has clients name, address, programname, date started,
terminated date(isnull). 2ndquery has meeting date(used
parameter between[start]and[end]), duration of meeting etc.

when i run the query it works fine, but when i open the
report, it will prompt me like 5 times for the start and
end date before it opens the report, why???


It sounds like the 2nd query is the record source for a
subreport and the main report has 5 detail records. If so,
that would explain being prompted 5 times.

Instead of using prompt string type parameters in the query,
you should use a form for the users to enter the start and
end values along with a buttom to open the report.

If you do that, you have two easy ways to filter the data
for the report. One is for the query to use parameters
like:
Forms!theform.starttextbox

The other way is to leave the query without criteria and use
the OpenReport method's WhereCondition argument instead:

DoCmd.Open Report "thereport", _
WhereCondition:="[Date Started] Between " _
& Format(Me.starttextbox, "\#m\/d\/yyyy\#") _
& " And " & Format(Me.endtextbox, "\#m\/d\/yyyy\#")

I prefer the later approach because the query is then
unaware of the form.
 
Back
Top