473,395 Members | 1,653 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,395 software developers and data experts.

Multiple select list box

Hi there,
I am quite a novice to MS Access, and I would deeply appreciate help on the
following:
I have created a list box in a form. I wish for that list box to enter
multiple values from table X
into table Y. Selecting the multi-select property and changing it to
advanced lets me select multiple
entries, but they are not transferred to the destination field

Could you please help?

Thank you in advance

Oren
Nov 13 '05 #1
3 11382

"Usenet" <pi@actcom.co.il> wrote in message
news:bH***************@newsread1.dllstx09.us.to.ve rio.net...
Hi there,
I am quite a novice to MS Access, and I would deeply appreciate help on the following:
I have created a list box in a form. I wish for that list box to enter
multiple values from table X
into table Y. Selecting the multi-select property and changing it to
advanced lets me select multiple
entries, but they are not transferred to the destination field

Could you please help?

Thank you in advance

Oren


You will need some kind of button that carries out this action...
(once all the entries you want have been selected)
The code behind this would loop through what has been selected and insert it
into the other table.

Not really complicated....but unless you have done some coding before, you
are in for a learning curve.

Mal.
Nov 13 '05 #2
Please don't do this.

Storing multiple values in one field, or in multiple fields within the same
table is going to severely limit the performance, flexibility, and
queriability of your database. You need to create at related table to hold
the (potentially) many values. See:
Description of database normalization basics in Access 2000
at:
http://support.microsoft.com/?id=209534

Once you have set up the correct structure, you will want to interface it
with a subform where the user selects as many values as apply, one per row.
The subform can use a combo for selecting the value on each row.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Usenet" <pi@actcom.co.il> wrote in message
news:bH***************@newsread1.dllstx09.us.to.ve rio.net...
Hi there,
I am quite a novice to MS Access, and I would deeply appreciate help on
the
following:
I have created a list box in a form. I wish for that list box to enter
multiple values from table X
into table Y. Selecting the multi-select property and changing it to
advanced lets me select multiple
entries, but they are not transferred to the destination field

Could you please help?

Thank you in advance

Oren

Nov 13 '05 #3
"Mal Reeve" <lo*****@earthlink.net> wrote in message news:<kY*****************@newsread2.news.atl.earth link.net>...
"Usenet" <pi@actcom.co.il> wrote in message
news:bH***************@newsread1.dllstx09.us.to.ve rio.net...
Hi there,
I am quite a novice to MS Access, and I would deeply appreciate help on

the
following:
I have created a list box in a form. I wish for that list box to enter
multiple values from table X
into table Y. Selecting the multi-select property and changing it to
advanced lets me select multiple
entries, but they are not transferred to the destination field

Could you please help?

Thank you in advance

Oren

There's code here for walking the selected items in a Multi-select
listbox:
http://www.mvps.org/access/forms/frm0007.htm

Inside the loop, you could insert something like

db.Execute "INSERT INTO MyTable VALUES ('" & varItem "')",
dbFailOnError
so...

'******************** Code Start ************************
Dim frm As Form, ctl As Control
Dim varItem As Variant
Dim strSQL As String
Dim db as DAO. Database

Set db=CurrentDb
Set frm = Form!frmMyForm
Set ctl = frm!lbMultiSelectListbox

'Assuming long [EmpID] is the bound field in lb
'enumerate selected items and
'concatenate to strSQL
For Each varItem In ctl.ItemsSelected
strSQL = "INSERT INTO Tasks (TaskDescription) VALUES '" &
ctl.ItemData(varItem) & "'"
db.Execute strSQL, dbFailOnError
Next varItem

set ctl=nothing
set frm=nothing
set db=Nothing

End Sub
'******************** Code end ************************
Nov 13 '05 #4

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

Similar topics

0
by: rich | last post by:
I have a database with 1 to many and the many is a list with multiple selects in a list. When I click on a master record I have as part of my form the select statement for the multiple choice...
3
by: imrantbd | last post by:
This is my first problem.Please help me. I have the following code: <head> <script language="JavaScript"> function addSrcToDestList() { destList1 = window.document.forms.destList; srcList...
3
by: imrantbd | last post by:
I need array type name like "destList" must use for my destlist select box,not a single name.Or need a solution to capture multiple value of "destList" select box and send all selected value in php...
1
by: Jeff Gardner | last post by:
Greetings: I have a table with 3 pieces of data that I would like to use to dynamically populate 3 drop downs using javascript. The fields are state, orgname, office. If it's not already...
3
by: swethasivaram | last post by:
Hello I have a multiple select list as follows: <select name="selList" multiple> <option value="1"Item 1</option> <option value="2"Item 2</option> <option value="3"Item 3</option> </select>
4
by: rn5a | last post by:
A Form has 2 select lists. The 1st one whose size is 5 (meaning 5 options are shown at any given time) allows multiple selection whereas the 2nd one allows only 1 option to be selected at a time. ...
2
by: billa856 | last post by:
Hi, My Project is in MS Access. In that I have one form in which I have some textboxes,comboboxes and listboxes. Now when I select value from 1st combobox(CustomerID) then it wil generate list for...
2
by: permander kumar | last post by:
hi plz help me, i have a code in which two multiple selection dropdown list. in first list if I am select single value the data are fetch in second table on button click. but the problem is in...
1
by: KrazyKasper | last post by:
Access 2003 – Multi-Column List Box – Select Multiple Items I have a multi-column (3 columns) list box that works well to select one set of records or all sets of records (based on the first field...
6
by: woodey2002 | last post by:
Hi Everyone. Thanks for your time. I am trying to create a search form that will allow users to select criteria from multiple multi select boxes. So far i have managed to achieve a search option...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
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...

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.