Hey guys,

Although I decided against using a listbox and simply just using a subform, I did spend a lot of time trying to figure out how to get the listbox to store more than one values for that field. If the listbox multiselect property is on "None", it stores, obviously, the one and only value selected. However, when I enable either "Extended" or "Simple", it stores none of them - no matter if its one or more.

Based on this, it is my impression that lisboxes are more effective for queries rather than selection and data entry.

The reason i bring this up is because I was trying to create a matrix with multiple values. For example:

A B C
John x x
Bob x x
Tom x x

Like I said, I used a subform with checkboxes. But I am still very curious as to how to multi-select listboxes can store values.

Any takers?

also, i read something about cross tab queries, however, i'm not sure if thats what I was looking to do.

I don't believe a multi-select listbox can have a control source. Instead, I have used multi-select listboxes and recorded the data using vba. I simply created a loop to go through each of the selected items and recorded each as a seperate record into a table.

As far as the awway, I would need more information to figure out how I would set it up. Does the array have a set size? Cross tab queries can be used for arrays, but they are used for displaying or performing calculations on data, not for data input. To store an array, you will need to create fields to store the location of values and then a field to store the value itself. For example:

ID X Y Value
1 1 1 2
2 1 2 4
3 2 1 6
4 2 2 8

The cross-tab query would then use X as a row heading, Y as a column heading and Value as the Value.

ahh so its not what I'm looking for. In terms of space, having seperate records wouldnt work because It would have to be stored to the program. And arrays are just like a virtual table, like you said, to do the calculations and return a value. I guess its better that I just did a subform. I'll save cross-tab queries for another day :)

Thanks again, Tim. You're always quick to respond. I appreciate it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.