Results 1 to 5 of 5
  1. #1
    Star Lounger
    Join Date
    Jan 2001
    Posts
    65
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Selecting Queries from Combobox (Access 2000 SR1 and Win XP Pro)

    On an Access form, I would like to be able to select different queries from a combox and have the results appears below. For example, I will create queries with names that correspond to years (1996, 1997 and so on). Then, I would like to add these to a combobox and be able to select whichever one I want and have the results appear on that form. Is this possible and if so could you help me with the steps I must go through to achieve it? Thank you for your help.
    Gary Hunt

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Selecting Queries from Combobox (Access 2000 SR1 and Win XP Pro)

    If you have a fixed set of queries you want to use, you can probably adapt the example attached to <post#=132267>post 132267</post#>. The first combo box in the main form of that example lists some tables, but they could be queries as well. Look at the Row Source property of the combo box.

    (Note: the attachment to that post is a zipped Access 97 database; you'll have to unzip and convert it.)

    It's also possible to use code to fill the row source of the combo box with a list of all queries in the database, or with a list of queries whose names meet specific criteria. Post back if that's what you want.

  3. #3
    Star Lounger
    Join Date
    Jan 2001
    Posts
    65
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Selecting Queries from Combobox (Access 2000 SR1 and Win XP Pro)

    Hans,
    This is a wonderful example which I might adapt for this purpose but also I would be interested in the code example not adding all queries but ones that I would selct for each combobox. Thank you for your help on this.

    Gary Hunt

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Selecting Queries from Combobox (Access 2000 SR1 and Win XP Pro)

    Gary, if you take a look at the threads beginning at <post#=140553>post 140553</post#> and at <post#=186365>post 186365</post#>, you'll find some ideas of how to tackle this. The threads are about listing forms and reports, respectively, but it shouldn't be too hard to adapt them for queries.

  5. #5
    Star Lounger
    Join Date
    Jan 2001
    Posts
    65
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Selecting Queries from Combobox (Access 2000 SR1 and Win XP Pro)

    Hans,

    Thanks so much again. I will review these and see if I can do anything with them. I am still new to Access although I have had much experience with Word.
    Thanks again very much.

    Gary

Posting Permissions

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