G
Guest
Is there a way that you can auto populate a text box when you choose
something in a drop down box?
something in a drop down box?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Allen Browne said:There's a couple of ways.
One is to use the AfterUpdate event of the combo to set the value of the
text box. To see an example, open the Northwind sample database, the Orders
Subform, and look at the ProductID combo. Its AfterUpdate looks up the
current price of the product, and drops it into the text box for price.
The other way is to just use the text box to show what is in one of the
other columns of the combo's RowSource. For example, if the value you want
is in column 2 of the combo, you would set the Control Source of your text
box to:
=[Combo1].Column(1)
(Note that the first column is zero, the 2nd is 1, and so on.)
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Reply to group, rather than allenbrowne at mvps dot org.
KRDitch said:Is there a way that you can auto populate a text box when you choose
something in a drop down box?
esca007 said:Hi Allen,
I have a variation of the same problem as KRDitch. My problem is that I
have
various field box from the same record source, but when I choose the ID,
the
other info does not auto populate when it suppose to. I've tried following
the northwind database method but it still doesn't work. Can you provide
me
insight? thanks
esca007
Allen Browne said:There's a couple of ways.
One is to use the AfterUpdate event of the combo to set the value of the
text box. To see an example, open the Northwind sample database, the
Orders
Subform, and look at the ProductID combo. Its AfterUpdate looks up the
current price of the product, and drops it into the text box for price.
The other way is to just use the text box to show what is in one of the
other columns of the combo's RowSource. For example, if the value you
want
is in column 2 of the combo, you would set the Control Source of your
text
box to:
=[Combo1].Column(1)
(Note that the first column is zero, the 2nd is 1, and so on.)
KRDitch said:Is there a way that you can auto populate a text box when you choose
something in a drop down box?
Have you ever figured this out? I was having the same problem with trying to
get data to populate into the text box. I followed the advice of putting
referring the 2nd column of the combo box. However, when I enter another
record, It changes all the previous entries to the current entry for the
combo box and the text box.
I've not been able to get anywhere with this.
When I type in =[TableName].Column(0) into the Control Source, brackets are
put around the word Column. I get the Name? error. I've tried adding it as
code in After Update, but just get blanks.
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.