Is this Possible - Dynamic Field Selection within a QBE grid?

  • Thread starter Thread starter Zoomiest
  • Start date Start date
Z

Zoomiest

I have a combo box that looks up a the feilds in a table.

Then, in my QBE grid, (that a report is based on), in the FIELD row, I
say [Forms]![frmQuery_Control_Panel].[cboLAQ]

so it will pick up the field that was chosen, by my combo box on a
form.

But I haven't gotten it to work... Any suggestions?


(Access just wants to turn it into a an expression: Expr1:[Forms]!
[frmQuery_Control_Panel].[cboLAQ]
which doesn't help me very much. Is there another way to do this? (so
I don't have to build a query/report for every field we want to report
on)?
 
I have a combo box that looks up a the feilds in a table.

Then, in my QBE grid, (that a report is based on), in the FIELD row, I
say [Forms]![frmQuery_Control_Panel].[cboLAQ]

so it will pick up the field that was chosen, by my combo box on a
form.

But I haven't gotten it to work... Any suggestions?


(Access just wants to turn it into a an expression: Expr1:[Forms]!
[frmQuery_Control_Panel].[cboLAQ]
which doesn't help me very much. Is there another way to do this? (so
I don't have to build a query/report for every field we want to report
on)?

It sounds like you've made the very common mistake of storing data in
fieldnames.

You indeed cannot pass a fieldname as a parameter in the QBE grid (in a
properly normalized database you wouldn't need to). The only solution is to
use the AfterUpdate event of the combo box to construct a SQL string.

What are the fieldnames that you're trying to select? How is your table
structured?
 
Back
Top