Multiple Select Listbox help

  • Thread starter Thread starter Richard
  • Start date Start date
R

Richard

I have a multiselect listbox that does not "save" the
selection when moving between records in "extended"
setting. When I change to "simple", the selection is
applied to all records.

I want to make selections for individual records and
maintain the selections when I return to that record. How
can I do this? Thanks.
 
Richard said:
I have a multiselect listbox that does not "save" the
selection when moving between records in "extended"
setting. When I change to "simple", the selection is
applied to all records.

I want to make selections for individual records and
maintain the selections when I return to that record. How
can I do this? Thanks.


The problem here is where do you want to "save" those selections? You can't
put more then one value into a field?

If you have a persons field called "PersonName":

PersonName: "John Smith"

I use a listbox to select more then one name...how can we put that into the
field ? Also, if we some how in some strange and bazaar way put to names in
to one field...how can we sort, search, and report on that field with two
values? Lets say we stuff two values in with a comma:

PersonName: "John Smith", "Albert Kallal"

I now can't go:

Look for PersonName = "John Smith".

So, you are asking why can't the listbox store more then one value in a
field?

Answer:
You can't put more then one value into a field. And, if you could...you
would make a mess of your database.

So, if you need to store a bunch of information that belongs to one
customer, then you need to build another table, and "relate" that
information back to the customer.

In your case, you would make a sub-form, a new table, and then likely use a
combo box to select the value, and then move to the next record..
 
I have now created a textbox that will store multiple
listbox selections in it using a loop, but the selections
carry over to the next record and I don't know why. (Let's
just assume that if multiple selections are in one field
it's ok for my purposes). The loop is as follows within
afterupdate:

Dim var As Variant
Dim ctl As ListBox
Dim str As String
Set ctl = Sport
For Each var In ctl.ItemsSelected
str = str & ";" & ctl.ItemData(var)
Next var
Me!txtsport = Mid(str, 2)

Why does the ItemsSelected property carry over to the next
record? I just want each record to store the multiple
selections and have the next record store it's selections.

Thanks
 
Back
Top