By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,710 Members | 1,312 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,710 IT Pros & Developers. It's quick & easy.

What's the best way to do this in Access2000?

P: n/a
I have three text fields, A, B, C on a form. I want to be able to
select data from a combo-box (or list-box) and then populate those
three fields based on what was selected.

Any code-snippets or pointers to code would be appreciated.

TIA

Bill
Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On 16 Jul 2004 09:19:57 -0700, bw******@lucent.com (Bill W.) wrote:
I have three text fields, A, B, C on a form. I want to be able to
select data from a combo-box (or list-box) and then populate those
three fields based on what was selected.

Any code-snippets or pointers to code would be appreciated.


It depends on where the values for A, B and C come from.

But generally you are talking about using the AfterUpdate event of the
combobox to populate the textboxes. If the overhead isn't too much
you might consider adding three columns to the data which is used to
populate the combobox and then having the AfterUpdate event just move
the values of those three columns to the textboxes.

Let's say you have a combobox that currently has 2 columns in it (id
and value) where value is what is displayed to the user. You would
make the five columns id, value, A, B, C and make the column widths
something like: 0", 0.75", 0",0", 0". This effectively hides the last
three columns.

Then, in the AfterUpdate event you just include code like this:

me.TextBoxA = me.cboBox.column(2)
me.TextBoxB = me.cboBox.column(3)
me.TextBoxC = me.cboBox.column(4)

Note that the column index is zero based and that 2,3, and 4 above
therefore apply to the 3rd, 4th and 5th columns of the data.

mike
Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.