[AccessD] Crosstab uses form criteria not

Bob Heygood bheygood at abestsystems.com
Tue Jun 15 17:51:35 CDT 2010


Thanks a lot to both of you.
I thought I was missing something as I used the same query for the source of
a totals query too.

Can't wait to test.

Bob Heygood
 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan
Sent: Tuesday, June 15, 2010 3:21 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Crosstab uses form criteria not

An alternative which many of us use is to create a Static function to store
the value {Forms]![frmReports]![cboMonths] and use that function as the
criteria in the query instead. 

Something like

Static Function MonthStore(optional months as long = 0) as long Dim Store as
Long If months > 0 then Store = months MonthStore = Long End Function

Then in the code of your form (button on_click or whatever) ...
Monthstore cboMonths
Docmd.Openquery "myCrosstab"
...


--
Stuart

On 15 Jun 2010 at 16:33, Heenan, Lambert wrote:
> The short answer is yes, Jet treats crosstabs slightly differently.
> 
> You need to open the query in design view and then from the 'Query'
> menu select 'Parameters'. You will get a little dialog box where you 
> have to enter the names of the parameters and the data type.
> 
> HTH
> 
> Lambert
> 
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com 
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Bob Heygood
> Sent: Tuesday, June 15, 2010 3:56 PM
> To: 'Access Developers discussion and problem solving'
> Subject: [AccessD] Crosstab uses form criteria not
> 
> Hello to the list,
> 
> I have a query that uses a couple of references to controls on a form to
limit the date range for criteria.
> It works just fine.
> 
> When I try to use the same query as a source for a second query
(crosstab), Access barfs and says:
> "The Microsoft jet database engine does not recognize
'{Forms]![frmReports]![cboMonths]' as a valid field name or expression"
> 
> Does not the same jet engine work the same when creating a crosstab?
> 
> Thanks in advance,
> 
> Bob Heygood
> 
> 
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com


-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list