Display the first field value of a combo box inside a textbox

Pookiemeister

Active Member
Joined
Nov 26, 2015
Messages
316
Office Version
  1. 365
  2. 2010
I am sorry if the title is confusing.
As of now, I have a table with an autonumber in the first field and Plant Names in the second field. On my form I have a disabled textbox and a combox that uses the table to populate it. In the property sheet, I have column count set to 2, column width set to 0.00125",1.1"(this only shows the second field in the combo box) and List Width=1.1".
Is there a way, depending on what is selected from the combo box, to display the first field value only in the textbox?

Thank you
 

Some videos you may like

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,274
Office Version
  1. 365
Platform
  1. Windows
Do you want to populate the textbox with the value from the first column of the listbox when a row is selected in the listbox?
VBA Code:
TextBox1.Value = ListBox1.List(ListBox1.ListIndex, 0)
 

Micron

Well-known Member
Joined
Jun 3, 2015
Messages
2,059
Office Version
  1. 365
Platform
  1. Windows
The control with the list is a combo?
Me.YourTextBoxName = Me.YourComboName.Colum(0)
Use the AfterUpdate event of the combo. You might need something else as well if you're navigating records on a single record form.
 

Watch MrExcel Video

Forum statistics

Threads
1,127,927
Messages
5,627,675
Members
416,264
Latest member
Dezmo

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
Top