473,405 Members | 2,154 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,405 software developers and data experts.

Form Input handling of Many-to-Many Relationship in Access

I have a form that is fed by a certain table. This table connects to
an intermeddiate table and then a look up table. All of this is done
to accomplish a many-to-many relationship. Imagine that the form's
table represents employees in a company and let's assume that an
employee can belong to multiple departments. The lookup table
mentioned above is represents the departments and the intermediate
table represents the many-to-many relationship. I would like to have
an employee input form that contains a drop-down list that allows a
user to select the multiple departments someone can belong to. Please
advise. Thanks in advance
Nov 12 '05 #1
4 9479
Base the form on a query that returns employee list. On the form, create
a combo box which row source is set to something like

SELECT DepartmentName FROM tblDepartments INNER JOIN JunctionTable ON
tblDepartments .DepartmentID = JunctionTable.DepartmentID WHERE
JunctionTable.EmployeeID = Forms!MyForm!EmployeeID

replace DepartmentID and EmployeeID with appropriate PK/FK fields.
Good luck,
Pavel

JSMiami wrote:

I have a form that is fed by a certain table. This table connects to
an intermeddiate table and then a look up table. All of this is done
to accomplish a many-to-many relationship. Imagine that the form's
table represents employees in a company and let's assume that an
employee can belong to multiple departments. The lookup table
mentioned above is represents the departments and the intermediate
table represents the many-to-many relationship. I would like to have
an employee input form that contains a drop-down list that allows a
user to select the multiple departments someone can belong to. Please
advise. Thanks in advance

Nov 12 '05 #2
Hi there,

I needed to do just this very recently and learned how to do it via the
Northwind.mdb demo database which ships with Access. Just do a search on
your machine for Northwind.mdb. Look at the relationships window and you'll
see a junction table (Order Details) in use with Products and Orders. Look
at Customer Orders Subform2 and the query Order Details Extended in order to
get started.

HTH.
Linda
"JSMiami" <js*****@unete.com> wrote in message
news:44**************************@posting.google.c om...
I have a form that is fed by a certain table. This table connects to
an intermeddiate table and then a look up table. All of this is done
to accomplish a many-to-many relationship. Imagine that the form's
table represents employees in a company and let's assume that an
employee can belong to multiple departments. The lookup table
mentioned above is represents the departments and the intermediate
table represents the many-to-many relationship. I would like to have
an employee input form that contains a drop-down list that allows a
user to select the multiple departments someone can belong to. Please
advise. Thanks in advance

Nov 12 '05 #3
Pavel, Thanks for the response. I just have one question, What do I
bind the control source of the multi-select list box to?

Thanks

Pavel Romashkin <pa*************@hotmail.com> wrote in message news:<40***************@hotmail.com>...
Base the form on a query that returns employee list. On the form, create
a combo box which row source is set to something like

SELECT DepartmentName FROM tblDepartments INNER JOIN JunctionTable ON
tblDepartments .DepartmentID = JunctionTable.DepartmentID WHERE
JunctionTable.EmployeeID = Forms!MyForm!EmployeeID

replace DepartmentID and EmployeeID with appropriate PK/FK fields.
Good luck,
Pavel

JSMiami wrote:

I have a form that is fed by a certain table. This table connects to
an intermeddiate table and then a look up table. All of this is done
to accomplish a many-to-many relationship. Imagine that the form's
table represents employees in a company and let's assume that an
employee can belong to multiple departments. The lookup table
mentioned above is represents the departments and the intermediate
table represents the many-to-many relationship. I would like to have
an employee input form that contains a drop-down list that allows a
user to select the multiple departments someone can belong to. Please
advise. Thanks in advance

Nov 12 '05 #4
Well, you don't have to bind it at all. This is what I would do.
I would write code in the AfterUpdate event of the list box or make a
command button to do what you want to happen when the user selects
something from the list.

Pavel

JSMiami wrote:

Pavel, Thanks for the response. I just have one question, What do I
bind the control source of the multi-select list box to?

Thanks

Pavel Romashkin <pa*************@hotmail.com> wrote in message news:<40***************@hotmail.com>...
Base the form on a query that returns employee list. On the form, create
a combo box which row source is set to something like

SELECT DepartmentName FROM tblDepartments INNER JOIN JunctionTable ON
tblDepartments .DepartmentID = JunctionTable.DepartmentID WHERE
JunctionTable.EmployeeID = Forms!MyForm!EmployeeID

replace DepartmentID and EmployeeID with appropriate PK/FK fields.
Good luck,
Pavel

JSMiami wrote:

I have a form that is fed by a certain table. This table connects to
an intermeddiate table and then a look up table. All of this is done
to accomplish a many-to-many relationship. Imagine that the form's
table represents employees in a company and let's assume that an
employee can belong to multiple departments. The lookup table
mentioned above is represents the departments and the intermediate
table represents the many-to-many relationship. I would like to have
an employee input form that contains a drop-down list that allows a
user to select the multiple departments someone can belong to. Please
advise. Thanks in advance

Nov 12 '05 #5

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

Similar topics

3
by: Krista | last post by:
Hi , hope u guys can help me out ... Can i do like that in php file? <form....> (doesnt work) <form....> ............ ...
2
by: michael nieuwenhuizen | last post by:
how do i create a sticky form with multiple fields? say i want a form with: name: address: country: and if a user presses the submit button it will show
1
by: Robert V | last post by:
Hi all, I could use some help programming on of my Perl script to handle different submit buttons within the same form. Here is what I have so far. A user goes to a Web form and inputs some data...
2
by: sindre | last post by:
Hi, I have a form with many fields. And then I thought I could have two other forms similar but here is only the submit button visible. What I want is: if the user click on a submit button on a...
11
by: Bremse | last post by:
Hi! I've got problem. Everything works fine when on line !1! is just single entry in if statement. Why after putting "&&" script doesn't work? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01...
7
by: x muzuo | last post by:
Hi guys, I have got a prob of javascript form validation which just doesnt work with my ASP code. Can any one help me out please. Here is the code: {////<<head> <title>IIBO Submit Page</title>...
12
by: Randell D. | last post by:
Folks, I have a form called "ourTestForm". Its a test form - nothing special - it contains five input tags - they are named one, two, three, four and five. The input tags are of type...
5
by: Werner Partner | last post by:
On my testpage http://www.sonoptikon.de/test.php I have this <table><tr> <td valign="top" align="center" style="width:150px;"> <form action=test.php method="get">
11
by: greg.scharlemann | last post by:
I've been playing with this form validation method for a while and have tried an array of things but haven't had any luck with a couple items. 1. The validateForm() function doesn't detect when...
2
by: mohawk411 | last post by:
Hello, I am having a problem with developing my form, when i click submit in ie the form validates itself and is submitted but when I open the form in firefox it will not validate or submit the form,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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
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
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
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...

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.