K
Ken Cobler
I've been having "fun" with using two combo boxes, the first one of which
determines the content of the second one. I then have the recommended
AfterUpdate event for the first one which then directs the SELECT...WHERE row
source is for the second.
This all works just fine, as long as I am editing Markets and Submarkets (my
two combo boxes) at the same time on a record...
Unfortunately the AfterUpdate only works if the first comboBox experiences
an Update. But when a user is later just scrolling through records, and
attempts to re-edit the second combobox, the SELECT...WHERE filter does not
work and ALL choices are shown. This is because there was no Update of the
first combobox.
I have experimented in vain with putting similar code in some other events,
but I am very new to event procedures and I get lots of weird results that
don't work.
For Further info, this is my AfterUpdate code for the cbxMarket combobox.
(I am controlling the fields Markets and Submarkets.)
Me!cbxSubmarket.RowSource = _
"SELECT SubmarketID, Submarket, MarketID " & _
"FROM tblSubmarkets " & _
"WHERE [MarketID] = " & Me!cbxMarket & " " & _
"ORDER BY tblSubmarkets.Submarket"
Thanks for your help!
determines the content of the second one. I then have the recommended
AfterUpdate event for the first one which then directs the SELECT...WHERE row
source is for the second.
This all works just fine, as long as I am editing Markets and Submarkets (my
two combo boxes) at the same time on a record...
Unfortunately the AfterUpdate only works if the first comboBox experiences
an Update. But when a user is later just scrolling through records, and
attempts to re-edit the second combobox, the SELECT...WHERE filter does not
work and ALL choices are shown. This is because there was no Update of the
first combobox.
I have experimented in vain with putting similar code in some other events,
but I am very new to event procedures and I get lots of weird results that
don't work.
For Further info, this is my AfterUpdate code for the cbxMarket combobox.
(I am controlling the fields Markets and Submarkets.)
Me!cbxSubmarket.RowSource = _
"SELECT SubmarketID, Submarket, MarketID " & _
"FROM tblSubmarkets " & _
"WHERE [MarketID] = " & Me!cbxMarket & " " & _
"ORDER BY tblSubmarkets.Submarket"
Thanks for your help!