Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Feb 2003
    Location
    Melbourne, Victoria, Australia
    Posts
    139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Parameter to select specific field name (Access SR-2)

    I have two tables.
    One table (Month) has a field called months which has twelve records, each containing a three letter abbreviation for each month ie. Jul, Aug, etc
    The other table (Data) has, in addition to other fields, twelve fields named "Jul", "Aug", "Sep" etc.

    I have a combo box which allows the user to select a record from table Month.
    I can use use this selection as a criteria in queries.

    What I also want to do is to use this same selection to select the fields in the queries.
    If the user select "Jul" from the combo box then placing this, [Forms]![Form1]![cboMonth], in the criteria part of a query returns all records having "Jul" in that field.

    How do I put/place/build [Forms]![Form1]![cboMonth] into the field row so that, in this case, the field will be "Jul".
    Regards
    Michael

  2. #2
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Parameter to select specific field name (Access SR-2)

    As I understand your situation, you want to be able to select which fieldname to include in a query based on the selection in a combo box?

    Now you know why the rules of normalization where designed, to avoid having to go through gyrations like this. This is what happens when you have arrays or lists in a data record.

    I don't know of any way to make this happen, short of redesigning your table structure.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  3. #3
    2 Star Lounger
    Join Date
    Feb 2003
    Location
    Melbourne, Victoria, Australia
    Posts
    139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Parameter to select specific field name (Access SR-2)

    Thanks Mark,
    Not much you can do with inherited db's.

  4. #4
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Parameter to select specific field name (Access SR-2)

    At some point in time, you will have to decide which is easier: a redesign or another patch.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

Posting Permissions

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