473,386 Members | 1,741 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

How to keep a selected item in a list highlighted


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
5 3839
"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

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
"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
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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: BBFrost | last post by:
Win2000 ..Net 1.1 SP1 c# using Visual Studio Ok, I'm currently in a "knock down - drag out" tussle with the .Net 1.1 datagrid. I've come to realize that a 'block' of rows highlighted within...
10
by: dhnriverside | last post by:
Hi guys Still having a problem with this dropdownlist. Basically, I've got 4. The first 2 work fine, then my code crashes on the 3rd. ddlEndTimeHour.Items.FindByValue(endTime).Selected =...
95
by: Jim Heavey | last post by:
Hello. When you use the ListView1.Item(0).Selected = true, this addis the item to items which show up int the ListView1.SelectedItems collection, but the item is not highlighted in the control. ...
1
by: Robin Tucker | last post by:
Hi ppl, My owner draw list box controls do not "refresh" old selected items when a new selection is made. This means that as you click to make selections, the previously selected items stay...
2
by: Hitesh | last post by:
I have a listbox and the values get selected (highlighted) from code. I can highlight the corresponding list box items, but they do not show in the listbox I have to scroll through the list box to...
3
by: rukkie | last post by:
I've made a webform in which some selection boxes are incorporated. Once the form is submitted the user can display the form again and all the options selected are highlighted (via the "selected"...
1
by: =?Utf-8?B?SmVmZiBUdQ==?= | last post by:
Hi, I'm using two menu controls. One is displayed at the top of the page. The other menu is displayed on the left side using a single site map. The top menu is for displaying level 1. The left...
2
by: Academia | last post by:
I have a combobox that when it drops down the selected item is not highlighted. I'm guessing there is a property that controls this but can't find one. Is there? Should it always be...
3
by: dvjava | last post by:
Hi, I am wondering if there is way to twist JList such that the highlight still remains on previously selected item after other item is selected. For example, this list has 4 items: A, B, C, D If...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.