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

Multi-select list box

yb
I have a unbound mult-select listbox field named
"Locations".Multi-select option is set to "Extended". I'm having
problem saving the values from this field into table. I have text
column currLocations in the table in which I want to store the selected
values.

I do not want to go with the approach of creating another hidden
textbox on the form and write code in AfterUpdate of the listbox field
to populate the selected values into the text field.

I have read about using subforms but do not know how to exactly do
it.please help!!

Thanks
YB

Nov 13 '05 #1
3 2370
This example assumes that for each client you want to store their favorite
colors.

You need these 3 tables:
Client table, with fields:
ClientID AutoNumber primary key
Surname Text
FirstName Text
...

Color table:
ColorID Text the color name.

ClientColor table:
ClientID Number relates to Client.ClientID
ColorID Text relates to Color.ColorID

Now on your Client form, place a subform bound to the ClientColor table. The
subform will show the client's fave colors, one per row. In the subform,
place a combo box you can select a color. The RowSource of the combo is the
Color table.

--
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.

"yb" <ya**********@hotmail.com> wrote in message
news:11**********************@c13g2000cwb.googlegr oups.com...
I have a unbound mult-select listbox field named
"Locations".Multi-select option is set to "Extended". I'm having
problem saving the values from this field into table. I have text
column currLocations in the table in which I want to store the selected
values.

I do not want to go with the approach of creating another hidden
textbox on the form and write code in AfterUpdate of the listbox field
to populate the selected values into the text field.

I have read about using subforms but do not know how to exactly do
it.please help!!

Thanks
YB

Nov 13 '05 #2
yb
I'm totally lost. Here is what I have:
Table Location:
Location_Id Text

Table Authorized_To_Work
Employee Name Text
Locations Text

form: lblLocations
Field: Location bound to Location.Location_Id and is set to Combobox

form: WorkAuthorization
I have inserted lblLocations but cannot get it to allow multiple
selections.

Please help!!
YB

Nov 13 '05 #3
The issue is that one employee can work an many different locations over
time, and one location can have many many people work there over time. There
is therefore a many-to-many relationship betwen employees and locations.

You already have a Location table and an Employee table. You need a 3rd
table to record who is authorized to work where when:

Location table
Location_ID (primary key)

Employee table
Employee_ID (primary key)
Surname
...

Authorized_To_Work table:
Location_ID relates to a record in Location.Location_ID
Employee_ID relates to a record in Employee.Employee_ID
WordDate when this person is to work here.

Now you will have a main form bound to the Employee table.
It will have a subform bound to the Authozed_To_Work table.
The subform will have a combo where you can select the location for the
employee.

With the same tables, you could interface this by location instead of by
employee if you wish:
- Main form bound to Location table;
- subform bound to Authorized_To_Work table.
The suborm will have a combo where you can select the employee for the
location.

It's really important to grasp this concept: the 3rd table (called a
junction table) resolves the many-to-many relationship into a pair of
one-to-many relationships.

For another example, see:
http://members.iinet.net.au/~allenbrowne/casu-06.html

--
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.

"yb" <ya**********@hotmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
I'm totally lost. Here is what I have:
Table Location:
Location_Id Text

Table Authorized_To_Work
Employee Name Text
Locations Text

form: lblLocations
Field: Location bound to Location.Location_Id and is set to Combobox

form: WorkAuthorization
I have inserted lblLocations but cannot get it to allow multiple
selections.

Please help!!
YB

Nov 13 '05 #4

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

Similar topics

37
by: ajikoe | last post by:
Hello, Is anyone has experiance in running python code to run multi thread parallel in multi processor. Is it possible ? Can python manage which cpu shoud do every thread? Sincerely Yours,...
4
by: Frank Jona | last post by:
Intellisense with C# and a multi-file assembly is not working. With VB.NET it is working. Is there a fix availible? We're using VisualStudio 2003 Regards Frank
12
by: * ProteanThread * | last post by:
but depends upon the clique: ...
0
by: frankenberry | last post by:
I have multi-page tiff files. I need to extract individual frames from the multi-page tiffs and save them as single-page tiffs. 95% of the time I receive multi-page tiffs containing 1 or more black...
6
by: cody | last post by:
What are multi file assemblies good for? What are the advantages of using multiple assemblies (A.DLL+B.DLL) vs. a single multi file assembly (A.DLL+A.NETMODULE)?
4
by: mimmo | last post by:
Hi! I should convert the accented letters of a string in the correspondent letters not accented. But when I compile with -Wall it give me: warning: multi-character character constant Do the...
5
by: bobwansink | last post by:
Hi, I'm relatively new to programming and I would like to create a C++ multi user program. It's for a project for school. This means I will have to write a paper about the theory too. Does anyone...
17
by: =?Utf-8?B?R2Vvcmdl?= | last post by:
Hello everyone, Wide character and multi-byte character are two popular encoding schemes on Windows. And wide character is using unicode encoding scheme. But each time I feel confused when...
0
by: Sabri.Pllana | last post by:
We apologize if you receive multiple copies of this call for papers. *********************************************************************** 2008 International Workshop on Multi-Core Computing...
2
by: Aussie Rules | last post by:
Hi, I have a site that Iwant to either display my text in english or french, based on the users prefernces ? I am new to webforms, but I know in winforms, this is pretty easy with a resource...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.