VBA reference ComboBox Column(1) with SQL Row Source (1 Viewer)

Rx_

Nothing In Moderation
Local time
Yesterday, 18:22
Joined
Oct 22, 2009
Messages
2,803
Couldn't not find this on Access World Forums. This is a VBA question.
Figured it out, so just posted the answer for others rather than a question.

Combo Box Name: MyComboBox
Control Source: Customers
Column Count: 2
Column Widths: 0";2"
Row Source: SELECT Customers.ID_Customers, Customers.Customers_Name.....From...
Bound Column: 1

Will write code in the Before_Update event.

What object code would provide both values?
(for example to pass into a function)
Answer:
MyCustomerID = Me!MyComboBox.Column(0)
MyCustomerName= Me!MyComboBox.Column(1)
 

boblarson

Smeghead
Local time
Yesterday, 17:22
Joined
Jan 12, 2001
Messages
32,059
That's been given as an answer numerous times here. (the search facility isn't that great but Googling the site works better). But it is good of you to post it as a specific item.
 

Users who are viewing this thread

Top Bottom