By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,269 Members | 1,506 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,269 IT Pros & Developers. It's quick & easy.

How to keep a selected item in a list highlighted

P: n/a

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

*** Sent via Developersdex http://www.developersdex.com ***
Nov 13 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
"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.


Nov 13 '05 #2

P: n/a

Thanks Brian. I probably didn't explain myself well in my query. I have
a text box into which the multi selections are stored. Basically, this
form is going to be used by different users, and when they select a
number of items on the list, these selections get stored in the text box
which I have hidden, so the user cannot see what selections were made.
Now if the user fills in part of the form today and makes some selctions
on a list, and comes back tomorrow to fill in the rest of the form, how
can he/she see what items were selected ie. how can I ensure that the
highlighted items remain highlighted, even though their selections are
saved in the db via the hidden textbox? I hope this makes sense.

Thanks, Silvia
ps. I am new to MS Access and still learning how to code in visual
basic, so I have a very limited knowledge at present (but learning
fast).
*** Sent via Developersdex http://www.developersdex.com ***
Nov 13 '05 #3

P: n/a
"Silvia" <an*******@devdex.com> wrote in message
news:Uv**************@news.uswest.net...

Thanks Brian. I probably didn't explain myself well in my query. I have
a text box into which the multi selections are stored. Basically, this
form is going to be used by different users, and when they select a
number of items on the list, these selections get stored in the text box
which I have hidden, so the user cannot see what selections were made.
Now if the user fills in part of the form today and makes some selctions
on a list, and comes back tomorrow to fill in the rest of the form, how
can he/she see what items were selected ie. how can I ensure that the
highlighted items remain highlighted, even though their selections are
saved in the db via the hidden textbox? I hope this makes sense.

Thanks, Silvia
ps. I am new to MS Access and still learning how to code in visual
basic, so I have a very limited knowledge at present (but learning
fast).

It makes a big difference if the form is bound or not. I did understand the
question and my first answer is still correct, but may not make much sense
to you at the minute.
I could send you an example if you let me know where to send it.
Nov 13 '05 #4

P: n/a
Thanks for your help, Brian. I'm sure your first response could do the
trick, I'm just not entirely sure how to go about it. I would appreciate
an example! You can send it to:
"kirkmans AT adu.uct.ac.za"

Many thanks.

*** Sent via Developersdex http://www.developersdex.com ***
Nov 13 '05 #5

P: n/a
"Silvia" <an*******@devdex.com> wrote in message
news:uj***************@news.uswest.net...
Thanks for your help, Brian. I'm sure your first response could do the
trick, I'm just not entirely sure how to go about it. I would appreciate
an example! You can send it to:
"kirkmans AT adu.uct.ac.za"

Many thanks

....sent
Nov 13 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.