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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trouble With Form and Crosstab Query

Status
Not open for further replies.

cdogstu99

MIS
Jan 17, 2005
68
US
hello all,
I have created a form to generate a report based on the critera chosen from my form which has two text boxes with start date, and end date, and a combo box to choose company.
Here's my sql:

TRANSFORM Sum(qrytestweeklycancels2.CountOfCustomers) AS SumOfCountOfCustomers
SELECT qrytestweeklycancels2.[Effective Date], qrytestweeklycancels2.[Insurance Company], Sum(qrytestweeklycancels2.CountOfCustomers) AS [Total Of CountOfCustomers]
FROM qrytestweeklycancels2
WHERE (((qrytestweeklycancels2.[Effective Date]) Between [Forms]![frmCancels]![txtStart] And [Form]![frmCancels]![txtEnd]) AND ((qrytestweeklycancels2.[Insurance Company])=[Forms]![frmCancels]![cboInsuranceCompany]))
GROUP BY qrytestweeklycancels2.[Effective Date], qrytestweeklycancels2.[Insurance Company]
PIVOT qrytestweeklycancels2.[Co/Assoc];

The query worked fine until i added the criteria from the form, when it now says:

The Microsoft Jet database engine does not recognize
[Forms]![frmCancels]![txtStart]as a valid expression

I have verified that it is the right path, what could be going on here?
Thanks
 
Add the form criterias as Parameters in your query. You'll have to add all three. If you are in the query grid design, right-click in the grey part above, and choose Parameters. Add them there.

g

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top