Repopulating combo-boxes

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

My system has one combo box that the selection affects the contents of all other combo boxes
My combo boxes all have the logic that only loads them in the 'on focus' event if the rowsource is blank
What is the best way to have all the dependent combo boxes reload when the other combo box selection is changed. Right now I am setting all the other rowsources to blank, but is there a better way?
 
In the AfterUpdate Event on the first combo box put the
following code

me.combobox2.requery
me.combobox3.requery

And so on. This will Update the values in the other combo
boxes based on the first.

-----Original Message-----
My system has one combo box that the selection affects
the contents of all other combo boxes.
My combo boxes all have the logic that only loads them in
the 'on focus' event if the rowsource is blank.
What is the best way to have all the dependent combo
boxes reload when the other combo box selection is
changed. Right now I am setting all the other rowsources
to blank, but is there a better way?
 
In that case, go to the Event "On Got Focus" for the combo
box and apply the code Me.(cmbName).Requery Method to it
at that point. That should only requery the combo box
data upon the combo box receiving the focus. However,
there are times when I've had to apply Me.Recalc
instead...not 100% sure why sometimes Recalc is needed
instead of Requery, but it happens sometimes. The Recalc
function recalculates the entire form, but does it fast
enough (usually) that the end user does not notice.

-----Original Message-----
Thanks for the reply but I dont want to repopulate any
combo box until it has the focus.
 
Back
Top