Yet another MS Access question

AsSiMiLaTeD
AsSiMiLaTeD Posts: 11,725
edited February 2008 in The Clubhouse
So I've built a form with two combo boxes. The options available in box 2 are based on the selection made in box one - so for example Polk Audio would be one of the choices in box 2 if speakers had been selected in box 1, but if power tools were selected in box 1 then Crasftman would be an option.

So I got that part working ok. here comes the delimna:

Let's say I make a choice in box 1, and then move to box 2, but then decided I want to go back and modify the selection in box 1. When I do that, the options in box 2 don't change, they stick with whatever the first selection in box 1 was.

Does that make sense - can anyone help?
Post edited by AsSiMiLaTeD on

Comments

  • AsSiMiLaTeD
    AsSiMiLaTeD Posts: 11,725
    edited February 2008
    I should also clarify, these fields are in a form with a bunch of other data, so reloading the entire form isn't going to be an option.
  • Sami
    Sami Posts: 4,634
    edited February 2008
    What are using to make the forms? VBA? You have to handle the selection changed event. Not sure as I don't do anything inside the DB application, only with Visual Studio, but I hope that helps you in the right direction.
  • tcrossma
    tcrossma Posts: 1,301
    edited February 2008
    Yep, you'll basically just need to place some code in the Change of Click event of the combobox to either fill up or refresh the other combo box's data.
    Speakers: Polk LSi15
    Pre: Adcom GFP-750 with HT Bypass
    Amp: Pass Labs X-150
    CD/DVD Player: Classe CDP-10
    Interconnects: MIT Shortgun S3 Pro XLR
    Speaker cables: MIT MH-750 bi-wire
    TT:Micro Seiki DD-35
    Cartridge:Denon DL-160
    Phono Pre:PS Audio GCPH
  • AsSiMiLaTeD
    AsSiMiLaTeD Posts: 11,725
    edited February 2008
    This is all built in Access, I'm not using VBA to build any of it.
  • AsSiMiLaTeD
    AsSiMiLaTeD Posts: 11,725
    edited February 2008
    I may just have to scrap the whole thing, I just don't think there's a way to do this in Access. I really don't even understand the reason I'm having the issue...
  • tcrossma
    tcrossma Posts: 1,301
    edited February 2008
    Access has VBA built-in, and it's very common to have to process and respond to events when building any useful form. Access handles most of these tasks for you but there's times when you need further control.

    As you are designing the form, click View=>Properties. There should be an "events" tab and you can create code in the "Change" or "Click" event.

    good luck.
    Speakers: Polk LSi15
    Pre: Adcom GFP-750 with HT Bypass
    Amp: Pass Labs X-150
    CD/DVD Player: Classe CDP-10
    Interconnects: MIT Shortgun S3 Pro XLR
    Speaker cables: MIT MH-750 bi-wire
    TT:Micro Seiki DD-35
    Cartridge:Denon DL-160
    Phono Pre:PS Audio GCPH
  • AsSiMiLaTeD
    AsSiMiLaTeD Posts: 11,725
    edited February 2008
    Oh yeah, I got all that, just didn't know the code to actually refresh it.

    I got it figured out though, I just had to had a [second box].requery command to the get focus and load events of the second box...

    Thanks