Populate a text box based on a combo box

  • Thread starter Thread starter Scott
  • Start date Start date
S

Scott

I have cascading combo boxes, first combobox dtermines what value is
displayed in the second. What I am trying to do is populate a text box based
on what is in the second combobox. Ex. 1st Combo- "Grocery Category" The
Categories are listed in one table (GroceryT) Ex. Beverage, Poultry etc.. 2nd
combo- "Grocery Type" These values are in seperate tables ex PoultryT,
BeverageT which lists all of the types of the particular type. What I would
like my text box to do is populate based on the second combo box and store it
within one of the tables. I have tried an unbound text box with the value
based on the the second column in the second combo box, it works but the
value is not stored anywhere. When you change records and go back it is not
displayed.

I hope this makes sense. Can Anyone help.
 
If you are storing the Primary Key of the second combo (which is what you
should be doing) you do not need to store any of the values. That said, use
the AfterUpdate event of the second combo to read the column into a bound
textbox like:

Private Sub Combo2_AfterUpdate()
Me.txtWhatever = Me.Combo2.Column(1)
End Sub
 
Back
Top