G
Guest
I'm trying to figure out how to (or if I can) have a Crosstab query datasheet
subform accept a selection criteria parameter from a Combo Box on the main
form.
I have a Main Form [frmOrgMaster] with 6 subforms, each on a tab.
[frmOrgMaster] has 2 Combo Boxes. You select a County in the
first Combo Box [cboCounties]. The [cboCounties] AfterUpdate Event Procedure
then requeries the second Combo Box [cboOrgs] which produces a list of
nonprofits in that County - and you choose one of them.
When you choose a specific nonprofit in [cboOrgs] the 6 subforms are
synchronized because each subform's LinkMasterFields property is set to
[cboOrgs].
But - I can't get one to work - [frmsubServices] which shows the services
provided by that nonprofit over the past several years. This subform has a
crosstab query datasheet that has years as columns, and specific services as
rows. But by itself this crosstab queries the entire database of 5000
nonprofits and produces a crosstab that has every service that any nonprofit
provides. I want to limit this crosstab only to the nonprofit chosen in
[cboOrgs].
Following a KB article (that wasn't about exactly what I'm trying to do) I
opened the Query/Parameters dialog for the crosstab query and set the
parameter as [Forms]![frmOrgMaster]![cboOrgs], with the appropriate data type.
I get what appears to be a dreaded error message - "You can't use a
pass-through query or non fixed column crosstab query as a record source for
a subform ..." Message tells me to set the query's ColumnHeadings property
before I bind the subform to a crosstab query.
I'm confused. Can someone help? Thanks
John D
subform accept a selection criteria parameter from a Combo Box on the main
form.
I have a Main Form [frmOrgMaster] with 6 subforms, each on a tab.
[frmOrgMaster] has 2 Combo Boxes. You select a County in the
first Combo Box [cboCounties]. The [cboCounties] AfterUpdate Event Procedure
then requeries the second Combo Box [cboOrgs] which produces a list of
nonprofits in that County - and you choose one of them.
When you choose a specific nonprofit in [cboOrgs] the 6 subforms are
synchronized because each subform's LinkMasterFields property is set to
[cboOrgs].
But - I can't get one to work - [frmsubServices] which shows the services
provided by that nonprofit over the past several years. This subform has a
crosstab query datasheet that has years as columns, and specific services as
rows. But by itself this crosstab queries the entire database of 5000
nonprofits and produces a crosstab that has every service that any nonprofit
provides. I want to limit this crosstab only to the nonprofit chosen in
[cboOrgs].
Following a KB article (that wasn't about exactly what I'm trying to do) I
opened the Query/Parameters dialog for the crosstab query and set the
parameter as [Forms]![frmOrgMaster]![cboOrgs], with the appropriate data type.
I get what appears to be a dreaded error message - "You can't use a
pass-through query or non fixed column crosstab query as a record source for
a subform ..." Message tells me to set the query's ColumnHeadings property
before I bind the subform to a crosstab query.
I'm confused. Can someone help? Thanks
John D