Listbox columns

S

SteveT

I have an access form with a Microsoft Forms 2.0 Listbox which I defined to
have four columns. I am unable to add any item to anywhere apart from the
first column.

Listbox7.additem callnum ......works fine
adds to the first column
Listbox7.column(1).additem callnum ...... fails and I
expected it to add to the second column

Can anyone help with the method of adding data to the Listbox columns.


Many thanks
ST
 
D

Douglas J. Steele

First of all, why are you using the Forms 2.0 listbox? What's wrong with the
one that's built into Access that you're not using it?

AddItem is intended to add the entire row at once. Concatenate the values
using semi-colons:

Listbox7.AddItem "Column1;Column2;Column3;Column4"

(remember that the RowSource is always a string, even if you're dealing with
numeric data)
 
S

SteveT

Many thanks...
The part developed form was inherited from another person and I thought the
Forms 2.0 listbox with columns was there as part of some grand master
scheme. It appears not so will revert to keeping it simple and sane!
 

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