how to populate a textbox based on a dropdown?

ticc888

Board Regular
Joined
Sep 10, 2003
Messages
156
Hi

I've basically got two questions,

1. first one is basic or rather I suppose most commonly requested technique which is a dropdown based on a dropdown.. the traditional country and state.. is there a definitive way to do this... without reading many posts?

2. how to have a textobx populate when upon dropdown box selection?

I'd like to have the dropdown read from a seperate table if that helps.. which in this case contians say

country, state and name connected to state (where first state is just abbreiviation).
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Too save space I too would like to be able to populate a text box with the selection I make in a dropdown !

And if possible have that text box display the option as a hyperlink!
I also (not that I want to much) want another text box to show the contents of another cell depending on the selection I make in the dropdown. I.e

If Combobox1 = "Apple"(Cell A2) thenTextbox1 = "Banana" (Cell B2)
 
Upvote 0
Have you looked at

DLookUp in Simple (sic) terms?

It seems that you are trying to do what Norie showed me how to.

N.B.
Norie has covered both Text and Numeric formats.

I don't mind sharing the example of a ComboBox database (Access 2000) if required. However I did spend hours trawling through the various posts before asking for help so please see if there is a soultion already posted before taking me up on this offer.

Bernard
 
Upvote 0
Hi
1. Cascading comboboxes
- Create and name the 2 combos. (cbo1 and cbo2 in our case)
- set the rowsource, bound columns, column widths et al for cbo1
- Set the row source etc fro cbo2, setting up a where clause to restrict the rows returned based on the bound column value from cbo1
- on the after update of cbo1 place the code Me.cbo2.requery

As for setting the value of a txtbox based on the value chosen in a cboBox. If you can avoud using domain aggregate functions, then do so as this is an 'expensive' process. Utilise sub forms or even better the fact that you can refer to any column in a cbo:
cboName.Column(n)
where n is the column number starting at 0

HTH
Jim
PS Check out Candace-Tripp.com/_pages/access_downloads.asp
for downloadable examples
 
Upvote 0

Forum statistics

Threads
1,221,816
Messages
6,162,149
Members
451,746
Latest member
samwalrus

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top