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

Pookiemeister

Well-known Member
Joined
Jan 6, 2012
Messages
548
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
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
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,357
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
4,593
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.
 

Forum statistics

Threads
1,186,112
Messages
5,955,900
Members
438,225
Latest member
rsur

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