Combo Boxes and updates

  • Thread starter Thread starter Ben
  • Start date Start date
B

Ben

I have a combo box that after I enter a certain acct type
that comes from an tblacct , I want it to populate the
text box rate. How would I accomplish this?

Ben
 
Presuming that your table, tblAcct, also contains a rate for each account
type ...

1. Make the RowSource of your combo box a query such as:

Select AcctType, Rate from tblAcct Order By AcctType

2. Set other properties of your combo box as follows:

Column Count: 2
Bound Column: 1

3. Now, in the AfterUpdate Event of your Combo Box, insert the following
code:

Me!Rate = Me!MyComboBox.Column(1)

Notes:
a) Change the control names I have used to the control names that you
are using
b) In VBA (as opposed to the form design), columns in a combo box are
numbered beginning with 0; therefore in VBA, when referring to Column(1),
the value of the second column will be returned.

hth,
 
Back
Top