Results 1 to 6 of 6

Thread: Columns

  1. #1
    Join Date
    Nov 2002
    Location
    Sweden
    Posts
    14

    Unanswered: Columns

    Hi!

    If I have for an example a table with 5 columns. How shall I now do to create a dymanic query containing only the 2 columns which I choose from a pair of comboboxes?

    /Sebastian
    Sebastian

  2. #2
    Join Date
    Oct 2002
    Location
    Leicester - UK
    Posts
    820
    let me get this straight, you've got a table with 5 fields and to what to use a combo boxes to select 2 of them

    if thats the case something along the lines of

    Select [forms]![ComboboxName]![value],[forms]![ComboboxName2]![value]
    from tablename;
    Definition of a Beginner, Someone who doesn't know the rules.

    Definition of an Expert, Someone who knows when to ignore the rules.

  3. #3
    Join Date
    Nov 2002
    Location
    Sweden
    Posts
    14
    Originally posted by m.timoney
    let me get this straight, you've got a table with 5 fields and to what to use a combo boxes to select 2 of them

    if thats the case something along the lines of

    Select [forms]![ComboboxName]![value],[forms]![ComboboxName2]![value]
    from tablename;
    Well, Ive tired that. Wont work
    Thanks anyway
    Sebastian

  4. #4
    Join Date
    Oct 2002
    Location
    Leicester - UK
    Posts
    820
    well theres always the VB method

    docmd.runsql "Select " & ComboboxName.value & ", " & ComboboxName2.value & " From tablename;"

    i don't use this type of method very often and i'm fairly certain that docmd.runsql is the wrong command to base the form on but it's a start, i'll check keep looking for a new one
    Definition of a Beginner, Someone who doesn't know the rules.

    Definition of an Expert, Someone who knows when to ignore the rules.

  5. #5
    Join Date
    Nov 2002
    Location
    Sweden
    Posts
    14
    Thanks, ill keep trying...
    Sebastian

  6. #6
    Join Date
    Oct 2002
    Location
    Leicester - UK
    Posts
    820
    yes i've found the problem with the first option i used and think i've fixed it,

    db1.mdb = a2000
    db2.mdb = a97
    Attached Files Attached Files
    Definition of a Beginner, Someone who doesn't know the rules.

    Definition of an Expert, Someone who knows when to ignore the rules.

Posting Permissions

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