Combo Boxes and updates

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
 
C

Cheryl Fischer

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,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top