multi-select listbox or combo box

M

mcnewsxp

is there such control as multi-select listbox or combo box for access?
if yes, how to activate?
if not, what are you using instead?

tia,
mcnewsxp
 
R

Rick Brandt

mcnewsxp said:
is there such control as multi-select listbox or combo box for access?
if yes, how to activate?
if not, what are you using instead?

tia,
mcnewsxp

ComboBox no, ListBox yes. A ListBox has a MultiSelect property that defaults to
"None" but which can be changed to "Simple" or "Extended". When either of those
are set the ListBox will always have a value of Null so you cannot use it to
enter data into a table directly. In Multi-Select mode a ListBox is only
intended to be used by a code routine.
 
M

mcnewsxp

i see that there is a multiselect listbox in access 2002.
how does one store multiple values in a field when storing an autonumber
keyfield.
 
M

mcnewsxp

what would be the best way to store the elected data if you knew that the
user would want it flattened eventually? the question is taken for a for
that uses check boxes. the question is race and the user may pick more than
one.
 
J

Jesper F

what would be the best way to store the elected data if you knew that the
user would want it flattened eventually? the question is taken for a for
that uses check boxes. the question is race and the user may pick more
than one.

Do you mean a flat table structure?
The recommended way to do what you want would be to use a subform and a
related table.
You probably could use the multiselect listbox and a one-table solution if
you really wanted to.
One way would be to have an invisible textbox on the form in addition to the
multiselect listbox. Whenever you change the listboxselection, you alter the
content of the textbox via code. The content of the textbox could be
";1;2;3;4;5;" with the numbers being index-numbers from the listbox.
All this would require code at the listbox' afterupdate event to syncronize
the content of the textbox with the selection and also som work in the
form's OnCurrent event to show the right selection.
Later on when you query the table you need to use ...[race] LIKE *" &
yourparam & "*.... to find records where for example race no. 3 is selected.
The approach fine but takes some time to set up. Could be an idea if you
need it to be flat.
Is this close to what you had in mind?

Jesper Fjølner, Denmark
 
M

mcourter

that is exactly what i had in mind and very close to what i was
thinking i would do. it may be simpler just to have boolean fields and
checkboxes even though this flies in the face of normalicy
(normalization rules). the users of this app will expect me to devise
a way for them to view all collected data in a flat structure in the
end so there is probably no need to work too hard in the other
direction.
thanks much.
 

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