"Silvia" <an*******@devdex.com> wrote in message
news:Z3*************@news.uswest.net...
Hi
I have a listbox in a form which has been set on multiselect simple. If
I select some of the items on the list on day1, save and exit, and
return on day2, the items I selected on day1 do not remain highlighted.
How do I ensure that when I return to the form on day2, that the items I
selected on day1 are still highlighted?
Thanks,
Silvia
The normal place to store things for database applications is in a field in
a table. So where are you going to store these mutiple items? Often this
is done with 3 tables, eg
tblContact = a list of people (contacts)
tblCategory = a list of categories (eg business, personal, cricket club,
etc)
tblConCat = 2-column table showing the categories each contact belongs to
So you have a main form bound to tblContact and the list box displays
records from tblConCat (the junction table) and refreshes when the form goes
to a new contact.
Perhaps though, you only need one table - tblListBoxItems which just
remembers the items, but in either case selecting or deselecting items
either adds or deletes records in a table.
This is not the only way to do it - you could do without a table and store
the items all in a string which was stored in a custom database property
e.g. "apple;orange;pear" then load the listbox from this string. It
requires a touch more coding, but is fairly standard.