By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
462,882 Members | 745 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 462,882 IT Pros & Developers. It's quick & easy.

Using a Form to set criteria for a crosstab query

P: 1
I am using Access 2002. I have created a query that has a crosstab query linked to it. The query runs fine initially. but I went back to add criteria to the query that is coming from a form and now I get the following error message as the query is running: "The Microsoft Jet database engine does not recognize [forms]![FormName]![fieldname] as a valid field name or expression.". If I remove the crosstab query link or save the crosstab data to a file and then link to the file the query runs fine using the form criteria. How can I get Jet engine to recognize the form fields? This only happens when using forms associated with crosstab queries.
Jun 8 '10 #1
Share this Question
Share on Google+
1 Reply

ahmedtharwat19
P: 55
TRY THIS:

Expand|Select|Wrap|Line Numbers
  1. Rem:DEFINE THE CRITERIA
  2. Dim stLinkCriteria As String
  3. stLinkCriteria = "[banking] =" & "true"
  4. Rem:OPEN REPORT WITH CRITERIA
  5. DoCmd.OpenReport "BankingReport", _
  6.  acViewPreview, "", stLinkCriteria, acNormal
BEST REGARDS ,

AHMED THARWAT (MEDO)
Jun 9 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.