form combo box

macamarr

Board Regular
Joined
Nov 1, 2002
Messages
52
Hi, & thanks for looking,

On my form I currently have a combo box that populates my Account description textbox. Is it possible to have it populate my account number text box too?
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Yes -- in fact, you can push every column in the data set of a combo box out to a different control. Here's how:

1. In the Properties for the Combo, select the RowSource row and hit the Builder (...) button to get the query grid. Let's say you build the query so you have the ID field first, then 3 other fields -- Field1, Field2, Field3. Close, save when prompted, and adjust the Column Count to match the no of fields in the query (4 for this example).

2. Click the Events tab, find the AfterUpdate event, click in there and hit the Builder button. If prompted for choices, slect Code and OK. In the code, put this:
[TextBox1] = [MyComboName].Column(1)
[TextBox2] = [MyComboName].Column(2)
etc.

Note: Column(1) is the SECOND field in the ComboBox query because the combo (and ListBox) columns are zero-indexed (0,1,2,3...)

Now, picking an item in the Combo should push the required data out to TxtBox1, 2, 3...

HTH

Denis
 
Upvote 0

Forum statistics

Threads
1,221,558
Messages
6,160,484
Members
451,651
Latest member
Penapensil

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