Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2003
    Posts
    10

    Unanswered: Selecting fields according to a form input

    Right now I have a number of queries with criterias like the following:

    [Forms]![MAIN_FORM]![ACCOUNTING_PERIOD]

    This works great for selecting records. But now I want to select fields.

    There is a query with an expression like this:

    "ytd_bgt: op010"

    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.

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    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.

    HTH
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •