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

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)?
 
J

John W. Vinson

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top