Assigning values to multiple List menu columns

B

Bill

Good day all

I'm trying to populate a list menu (Combo Box) with the results from a
query. The thing is I want the combo box to display the ID and Discription
but I need to use the ID as the value form submitting the form. I have a
value of 2 in the Column count and I'm trying to assign the value like so:

cboProjectIdDivision.Column(0).RowSource = projID
cboProjectIdDivision.Column(1).RowSource = projDescription

without any joy.

Any pointers here would be greatly appreciated.

Bill
 
A

Albert D. Kallal

If you have a query are SQL, and just use that for the combo box

dim strSql as string


strSql = "select projID,projDescription from tblProjects where ..bla bla
bla..."

Me.MyCombox.RowSource = strSql


That is all you need.

your problem a better off to use the wizard to build a combo box first based
on the two columns, has then that will let you size the columns and set up
the combo box the way you want. however, once you've built the combo box,
simply use the above line of code to stuff in the SQL that you have.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top