By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,117 Members | 1,093 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,117 IT Pros & Developers. It's quick & easy.

Multicolumn listbox add item

P: 25
Hello!

I have two textboxes and a multicolumn listbox on the form. User enters first name in one textbox and last name in the other. After "submit" button is clicked I want first and last name to be displayed in the listbox (first name in column 0 and last name in column 1). Can anyone help me with what list function I should use?
I've tried using listbox.additem function passing array as parameter, but that does not work.
Any help would be greatly appreciated.
Mar 14 '07 #1
Share this Question
Share on Google+
6 Replies


Rabbit
Expert Mod 10K+
P: 12,364
AddItem only works if the listbox is set to value list. And you don't pass it an array, you pass it a string.

If it's a table/query, then you can use a .Requery to refresh it.
Mar 14 '07 #2

P: 25
i have it set to "value list" and the reason i was trying to pass an array is because its a multicolumn listbox.
I used list1.additem string1 on listboxes with a single column, but I cant figure out how to apply it to populate values in different columns
Mar 14 '07 #3

Rabbit
Expert Mod 10K+
P: 12,364
Even with a multicolumn listbox you pass it a string.
Expand|Select|Wrap|Line Numbers
  1. "Value1;Value2;Value3"
Mar 14 '07 #4

P: 25
Thanks a lot. I spend hours trying to find it online... and all i had to do is separate values with semicolons.
Thanks a lot!!!
Mar 14 '07 #5

Rabbit
Expert Mod 10K+
P: 12,364
Not a problem, good luck.
Mar 14 '07 #6

P: n/a
Lol... I've done the exact same thing... Hours searching.

Thanks
Nov 25 '10 #7

Post your reply

Sign in to post your reply or Sign up for a free account.