473,498 Members | 1,833 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Select multiple items from drop-down list

Hello all...

I am using Access 2002, and am trying to find a way for a user to be
able to select multiple entries from a drop-down list. I am hoping
that given a list as such:

a
b
c
d
e

the user could select a, c and d, and have the field be saved as
a;c;d.

Is something like this possible? It doesn't have to be a drop-down
list, but some mechanism for the user to just select the desired
options without having to resort to check boxes for each option that
could be available. If so, how would I do the searching for queries,
ie, be able to select this record when searching for a, c or d.

Thanks in advance!
Therese
Nov 12 '05 #1
4 17613
"Therese A. Sorna" <ta*****@yahoo.com> wrote in message
news:be**************************@posting.google.c om...
Hello all...

I am using Access 2002, and am trying to find a way for a user to be
able to select multiple entries from a drop-down list. I am hoping
that given a list as such:

a
b
c
d
e

the user could select a, c and d, and have the field be saved as
a;c;d.


This violates proper database design. Fields should store one and only one value.
If you need to associate multiple values with a record you should add another table
with a one-to-many relationship between the current table and the new one. Then you
can have as many associated records as you need and still have each value in its own
row/field.

--
*******************************
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
*******************************
Nov 12 '05 #2
Therese,

If that is what you really want to do, you can write code like

ValueToSave =""
For each i in DropDownList.selected
If ValueToSave <> "" then
ValueToSave = ValueToSave & ", "
End If
ValueToSave = ValueToSave & DropDownList.Column(1,i)
Next i

ValueToSave should be bound to the table item where you want to store the
list.

Hope this helps,

Gary

"Therese A. Sorna" <ta*****@yahoo.com> wrote in message
news:be**************************@posting.google.c om...
Hello all...

I am using Access 2002, and am trying to find a way for a user to be
able to select multiple entries from a drop-down list. I am hoping
that given a list as such:

a
b
c
d
e

the user could select a, c and d, and have the field be saved as
a;c;d.

Is something like this possible? It doesn't have to be a drop-down
list, but some mechanism for the user to just select the desired
options without having to resort to check boxes for each option that
could be available. If so, how would I do the searching for queries,
ie, be able to select this record when searching for a, c or d.

Thanks in advance!
Therese

Nov 12 '05 #3
ta*****@yahoo.com (Therese A. Sorna) wrote in message news:<be**************************@posting.google. com>...
Hello all...

I am using Access 2002, and am trying to find a way for a user to be
able to select multiple entries from a drop-down list. I am hoping
that given a list as such:

a
b
c
d
e

the user could select a, c and d, and have the field be saved as
a;c;d.

Is something like this possible? It doesn't have to be a drop-down
list, but some mechanism for the user to just select the desired
options without having to resort to check boxes for each option that
could be available. If so, how would I do the searching for queries,
ie, be able to select this record when searching for a, c or d.

Thanks in advance!
Therese

Are you planning on saving the selections somewhere? (in a table)? If
so, use a subform. If you're just using these for query criteria or
something, there's code on www.mvps.org/access that has code that does
that.
Nov 12 '05 #4
ta*****@yahoo.com (Therese A. Sorna) wrote in message news:<be**************************@posting.google. com>...
pi********@hotmail.com (Pieter Linden) wrote in message news:<bf**************************@posting.google. com>...

Are you planning on saving the selections somewhere? (in a table)? If
so, use a subform. If you're just using these for query criteria or
something, there's code on www.mvps.org/access that has code that does
that.


I am not really familiar with subforms, but that sounds like it is
what I need. How would I do that? I don't want to have multiple
records to account for the multiple selections.

Thanks,
T


If you create two tables, say tblPerson and tblSelections

CREATE TABLE tblPerson(
PersonID AutoNumber PRIMARY KEY,
FirstName Text(20) NOT NULL,
LastName Text(20) NOT NULL);

CREATE TABLE tblSelections(
SelectionID Long NOT NULL,
PersonID Long NOT NULL,
PRIMARY KEY (SelectionID, PersonID));

You'd create a subform based on tblSelections and make SelectionID a
combobox and as the RowSource of the combobox, create a query (the
wizard will just about walk you through the whole thing)...

SELECT tblChoices.ChoiceID, tblChoices.ChoiceText
FROM tblChoices
ORDER BY tblChoices.ChoiceText;

Then you'd have 2 columns in your combobox, and the first column
bound. To hide the ChoiceID in the interface, set the ColumnWidths
property to 0;1 or something... the first column width = 0 to hide it.
Then you're pretty much off to the races. You can enter as many
UNIQUE values in the subform as you want... (Unique meaning the
combination of (PersonID and SelectionID) has to be unique.

HTH.
Pieter
Nov 12 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
10745
by: Rowland Hills | last post by:
I have a table which is returning inconsistent results when I query it! In query analyzer: If I do "SELECT * FROM TABLE_NAME" I get no rows returned. If I do "SELECT COL1, COL2 FROM...
6
4265
by: Ben Hallert | last post by:
Hi guys, I'm trying to figure out what bone headed mistake I made on something I put together. I've got a form (named 'context') that has a variable number of select-multiple inputs on it. ...
3
6004
by: rhamlin | last post by:
I'm fairly new to creating complex sql statements and need a little help. In plain english I want to do this: Select menu rows where the row's userGroupIDs equal the user's userGroupIDs. ...
2
4762
by: Tom Bray | last post by:
Ok I am baffled I can not figure out this problem. I am getting the following error: Portal Error - A DropDownList cannot have multiple items selected. Error information Name Value Message...
2
2656
by: Henry Padilla | last post by:
I'm trying to select multiple items in a listbox and the demo from the help file is not working. What do I do to select multiple items in a listbox? Code sample below. Tom P. ...
2
2246
by: Rob Long | last post by:
Hi I have an HTML select element in my page and it's multiple property is disabled (one item at a time mode) but I still want to transfer all the items in the select to the server when the form...
4
2440
by: Matt Ratliff | last post by:
Hello, I would appreciate any assistance you have with the following problem: I have (as an example) an array of values as follows: arrayvalues=new Array("0001","0003","0005") where each is the...
2
1981
by: Rowan | last post by:
I have a form that has several multiple select menus. I would like to save the multiple selections but be able to show them as selected items when the form data is updated. <select...
2
6922
by: 6afraidbecause789 | last post by:
Hi - Has anyone ever used toggle buttons to select items in a listbox? I'd like to put about 24 toggle buttons on an unbound form that select or deselect items in a multiple select listbox. I've...
25
5362
by: bonneylake | last post by:
Hey Everyone, Well i am not sure if my question needs to be here or in coldfusion. If i have my question is in the wrong section i am sorry in advance an will move it to the correct section. ...
0
7125
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7004
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
7208
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...
1
6890
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7379
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5464
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4915
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
1423
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
292
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.