Results 1 to 6 of 6
  1. #1
    Star Lounger
    Join Date
    Oct 2001
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts

    conditional combo box (2002 sp2)

    I'm sure this has been asked before but I couldn't find it by searching the archives. I would like to create two combo boxes. One pulling called Categories (populated from Categories table). The second box, ("Products" populated from from Products table), filtering/displaying data based upon the results from the first combo box, showing only data from that category. Thank you. sb.

  2. #2
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: conditional combo box (2002 sp2)

    Try searching the Access forum for two combo boxes - there are several recent threads that discuss the subject in some detail. Basically what you want to do is set the RowSource for the second combo each time you update the first combo. You may also need to do something to set it when the form initially loads.
    Wendell

  3. #3
    Star Lounger
    Join Date
    Oct 2001
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: conditional combo box (2002 sp2)

    I found this within the archives under two combo boxes:
    " In the query behind the Cities combobox add a column for the State with a criteria that the State would equal the value of the States combobox. So the criteria would look something like this for the State field: Forms!frmCityStateSelect!cboState. Then in the after_update event for the State combobox you would requery the City combobox: Me!cboCity.Requery"
    ** I tried this example and cannot get it to work. No errors, just no cities populating the city field. There are no other relevant threads that I have been able to find. Thank you for you help.

  4. #4
    3 Star Lounger
    Join Date
    Mar 2001
    Location
    Minneapolis, Minnesota, USA
    Posts
    262
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: conditional combo box (2002 sp2)

    See if this attachment helps at all; it's in Access 2000 format. The bits of interest are the form, the lone query, and the single line of code in the AfterUpdate event of the State combo box. Cheers!
    Attached Files Attached Files
    <font face="Comic Sans MS"><font color=blue>~Shane</font color=blue></font face=comic>

  5. #5
    Star Lounger
    Join Date
    Oct 2001
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: conditional combo box (2002 sp2)

    Thank you- I appreciate it. Looks like what I'm looking for.

  6. #6
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: conditional combo box (2002 sp2)

    There are a number of other posts that show up in a search, but here's <post#=172824>post 172824</post#> from today working on the same issue. You do need to run some VBA code to make it work, but it looks like Shane has given you a sample. I believe there is also a sample available in the Solutions database that you can download from the MS web site.
    Wendell

Posting Permissions

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