Multi Column List box

TallMan

Registered User.
Local time
Today, 09:23
Joined
Dec 5, 2008
Messages
239
Hey All,

I am having a horrible time trying to get 3 unbound text boxes to insert into one list box with three different columns.

I am essentially setting the information in the unbound text boxes to strings and then trying to add the strings into the value list, list box.


For example purposes let's act like I am only working with two unbound textboxes:

Dim str1 as string
Dim str2 as string

str1 = me.text1
str2 = me.text2

'''Now how do I get str1 into the first column of the list box and str2 in to the 2nd column in the list box?
'''I have something like this:

me.lstbox.column(1).additem(str1)
me.lstbox.column(2).additem(str2)

I am obvioulsy missing something, but cannot figure out the correct syntax.

Thanks in advance for all of your help!!

Tallman
 
If I understand correctly, you have a list box and 3 text box controls on a form and you want to supply values to the list box based on what a user enters in the 3 text box controls.

I found this link that might help. I also found a function that does the same thing on this site

I tried playing around with these and the values from the 3 text box controls do get added to the list box, but, if you close the form and then reopen it, the added values are no longer there.

I think it would better to base the list box on a table and then when you want to enter via the textboxes, just run an append query to add the new items to the underlying table. Then after the append finishes just requery the list box on the form. This will preserve the values as long as they remain in the table.
 
Thank you so much! I was able to use your first link to resolve my issue!

Tallman
 
You're welcome. Glad that worked out for you!
 

Users who are viewing this thread

Back
Top Bottom