Вопрос

I'm trying to add items (multiple columns) to a listbox. As I understand, in order to add multiple columns, you normally send them as strings like so:

Listbox.AddItem("column1;column2;column3")

This works for me just fine. But how do I add multiple columns when the item is not a string? I've tried things like:

Listbox.AddItem("name"; txtAge.Value)

and

Listbox.AddItem("name; txtAge.Value")

and even

Listbox.AddItem("name; Me![txtAge]")

None are working. I wasn't able to find anything on the web. What is the correct syntax?

Это было полезно?

Решение

You have to cast the txtAge to a String....

    LTrim(str(txtAge.value)) 

or

    CStr(txtAge.value)

Другие советы

You are almost there, just a little edit though:

Listbox.AddItem("name; " & txtAge.Value)

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top