Can't Ge A Report To Accept Paraemters

B

Brian

I have a report based on a crosstab query. The query runs fine and obeys the
date parameters taken froma calendar control. The report based on this same
query will not run. The report is fine if I remove the paramters but trying
to run it from the parameter control I get this message "Microsoft Jet
Database does not recognise " as a valid field name or expression. I have
made sure the input form does not close before the report is run. I have also
moved the parameters to an earlier stage of the query build and not on the
crosstab itself (I read on this site it was better practice). The query is
written as follows-
Design View
Field =TransDate
Between [Forms]![Main Menu]![txtstartdate] And [forms]![Main
Menu]![txtenddate]
SQL View
PARAMETERS [forms]![Main Menu]![txtstartdate] DateTime, [forms]![Main
Menu]![txtenddate] DateTime;
SELECT [QyPLINV&EXP].TransDate, [QyPLINV&EXP].Amt, [QyPLINV&EXP].DebExp
FROM [QyPLINV&EXP]
WHERE ((([QyPLINV&EXP].TransDate) Between [Forms]![Main Menu]![txtstartdate]
And [forms]![Main Menu]![txtenddate]));

Can Any body Help?
 
D

Duane Hookom

Are you in a location that uses a date format of mm/dd/yyyy?
Are there any other criteria other than the start and end dates?
What is the SQL view of the crosstab?
 
J

John Spencer

Usually when this happens to me I find out that the report is NOT based
on the query that I thought it was.

Check the source of the report.

Another possibility, is that the crosstab is not returning the same
fields as when you built the report. If that is the case, you can get a
message about the fields not being available.

'====================================================
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================
 
B

Brian

Thank you gentlemen for your suggestions ,sorry for the delay in my
acknowledging your advice (put it down to the UK-USA time difference).
I read some advice on a MS site and apparently the problem was due to the
fact I had not listed the column headings on the cross-tab query's property
sheet. I still don't fully understand but I think because I had created some
controls in the report
to total up the columns, these controls had to be listed on the Cross-Tab
query proprty settings. On a blank area of the query, right click to bring up
the Query Property and in the Column Headings Row I had to write "sales",
"expenses" - I didn't get the right names first time because they are not
genuine field name but eventually I hit the correct combination. So it is a
question of "It works though I'm not sure why".

Duane Hookom said:
Are you in a location that uses a date format of mm/dd/yyyy?
Are there any other criteria other than the start and end dates?
What is the SQL view of the crosstab?

--
Duane Hookom
Microsoft Access MVP


Brian said:
I have a report based on a crosstab query. The query runs fine and obeys the
date parameters taken froma calendar control. The report based on this same
query will not run. The report is fine if I remove the paramters but trying
to run it from the parameter control I get this message "Microsoft Jet
Database does not recognise " as a valid field name or expression. I have
made sure the input form does not close before the report is run. I have also
moved the parameters to an earlier stage of the query build and not on the
crosstab itself (I read on this site it was better practice). The query is
written as follows-
Design View
Field =TransDate
Between [Forms]![Main Menu]![txtstartdate] And [forms]![Main
Menu]![txtenddate]
SQL View
PARAMETERS [forms]![Main Menu]![txtstartdate] DateTime, [forms]![Main
Menu]![txtenddate] DateTime;
SELECT [QyPLINV&EXP].TransDate, [QyPLINV&EXP].Amt, [QyPLINV&EXP].DebExp
FROM [QyPLINV&EXP]
WHERE ((([QyPLINV&EXP].TransDate) Between [Forms]![Main Menu]![txtstartdate]
And [forms]![Main Menu]![txtenddate]));

Can Any body Help?
 

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