Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crosstab Query won't accept Parameters? HELP!

Status
Not open for further replies.

ahmun

IS-IT--Management
Jan 7, 2002
432
0
0
US
Hello everybody.

I got a problem and a limited time!

I'm trying to use a parameter query (whose source is a crosstab query) to custom-filter data on a table based on the user's selection of a Pull-down list.

But... I get the error message "The Microsoft Jet database engine does not recognize '[forms]![MainSwitchboard]![dtmCurrentMonthEnd]' as a valid field name or expression."

Can anybody help me get around this problem? Should I save all the values of the crosstab query in a temporary table to avoid this error message (I've used parameter queries on tables with no problem) or is there a simple trick?

MY setup is like so:
I have a table with an Accident Code and in it is a field for teh type of accident. The Accident type comes from a list of five values (A,B,C,D,E)

Code:
tblAccidents:
-------------
intAccidentCode
dtmDateofLoss
strAccidentType

I tried creating a crosstab query that looks like this:

Code:
qryAccidentsCrosstab:
---------------------
intAccidentCode
dtmDateofLoss
AccType_A
AccType_B
AccType_C
AccType_D
AccType_E

Finally, I created a query that pulls from this crosstab with a date field filtered based on the users selection (the reason I didn't put the date filter directly on the crosstab in the first place is cuz I would make 3 different queries, one for Month to Date, Year to date, project to date..).:

Code:
qryAccidents_MonthToDate
------------------------
intAccidentCode
dtmDateofLoss <-- dtmDateofLoss BETWEEN Forms!...dtmStartMonth AND Forms!...dtmEndMonth
AccType_A
AccType_B
etc.
.
.


Earnie Eng
If you are born once, you will die twice.
If you are born twice, you will die once
 
I have the same problem. It seems that this problem is unique to crosstab queries, because if you remove the TRANSFORM and PIVOT from the SQL, it runs fine. Saving it to a table won't work either. I have been working on this one for a while, and by the lack of responses, I assume no one else has any hints.
Dave
 
Dave,

Someone posted a very useful tip on my same question that I posted to a different forum... it might help you, too!

thread702-490127

Earnie Eng
If you are born once, you will die twice.
If you are born twice, you will die once
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top