06-07-06, 17:14 #1Registered User
- Join Date
- Oct 2003
Unanswered: Selecting fields according to a form input
Right now I have a number of queries with criterias like the following:
This works great for selecting records. But now I want to select fields.
There is a query with an expression like this:
In this case, it's just selecting the field "op010" (corresponding to accounting period "010") and naming it "ytd_bgt" in the result set. I'd like the "010" part of the name of the field it is selecting to be gotten from "[Forms]![MAIN_FORM]![ACCOUNTING_PERIOD]", so the user doesn't have to manually edit this query every month.
06-07-06, 18:00 #2Jaded Developer
Provided Answers: 59
- Join Date
- Nov 2004
- out on a limb
intrinsically there is nothing stiopping you from doing that, you 'just' have to do a bit more work
rather than use the parameter in the query directly, it may make more sense to write the query on the fly inthe calling form or report. you could use it as a filter or write the query as required. Yiou could write the SQL on the fly in the reports forms on open event, or call the report an set the filters as required
you 'just' need to check what parameters are selected for which fields.
HTHI'd rather be riding on the Tiger 800 or the Norton