How do you add items to an unbound multicolumn listbox?

  • Thread starter Thread starter Ian Sawyer
  • Start date Start date
I

Ian Sawyer

I have a form with a combo box(cboChoseItem), a text box
(txtQuantity), a listbox(lstOrder), and a command button
(cmdAddItem).

The combo box is a multicolumned combo box linked to a
table (tblProductList). It selects 5 fields
(Item,Description,W/S,Retail,Actual). The text box is for
a user input of a Quantity of the selected item in the
combo box.

I would like to have 6 columns in the listbox, one for
each field from the combo box, and one more for the
txtquantity.value.

I unfortunately cannot seem to figure out how to refer to
which row/column each of these items is to be entered in
the listbox. According to the help files you use ; between
each item using the additem method (e.g
lstOrder.additem "Hello;Mr;Krinkle") and it works for a
string.

However if i try lstOrder.additem cboChoseItem.Column(0) ;
cboChoseItem.Column(1) etc
i receive the expected end of statement error.

Any one got a solution?


Thank ya kindly
 
Hi,
Yep. It has to be a string so your ; has to be in quotes and concatenated
with the values:
lstOrder.additem cboChoseItem.Column(0) & ";" & cboChoseItem.Column(1) &
";" & etc

HTH
Dan Artuso, MVP
 
-----Original Message-----
Hi,
Yep. It has to be a string so your ; has to be in quotes and concatenated
with the values:
lstOrder.additem cboChoseItem.Column(0) & ";" & cboChoseItem.Column(1) &
";" & etc

HTH
Dan Artuso, MVP

AHAHAHAHAHAHAHAHA
I spent an entire week beating my head on solid objects
for a silly quotation mark... thank you very much kind
sir :)
 
Back
Top