473,756 Members | 9,668 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Form Design with Linking Table

Using A2K3, Windows XP

I'm handling a many-to-many relationship with a linking table
structure as follows (irrelevant fields omitted):

tblIssue
PK_IssueID (autonumber, primary key)
IssueName (text)

tblArea
PK_AreaID (autonumber, primary key)
AreaName (text)

tblIssueArea
PK_IssueAreaID (autonumber, primary key)
FK_IssueID (foreign key linked to tblIssue.PK_Iss ueID)
FK_AreaID (foreign key linked to tblArea.PK_Area ID)

I'm trying to design a form for adding/editing Issues that will list
all AreaNames with a checkbox next to each, so that the user can mark
which AreaNames are associated with the issue he's adding/editing.
I've tried creating a subform, but with subform Master/Child links
being one-to-one relationships, I can't figure out how I'd be able to
have all AreaNames available.

I know I could do it the hard way without a subform, by dynamically
recreating the main form every time it's opened, looping through each
value in tblArea to create the checkboxes and labels, looping through
tblIssueArea to set the proper value of each checkbox, then running
Append/Delete queries on tblIssueArea for each time one of the
checkbox values changes. But I've gotta think there's an easier way!

Thanks in advance for any suggestions..

Jun 8 '07 #1
3 2243
Robert McEuen wrote:
Using A2K3, Windows XP

I'm handling a many-to-many relationship with a linking table
structure as follows (irrelevant fields omitted):

tblIssue
PK_IssueID (autonumber, primary key)
IssueName (text)

tblArea
PK_AreaID (autonumber, primary key)
AreaName (text)

tblIssueArea
PK_IssueAreaID (autonumber, primary key)
FK_IssueID (foreign key linked to tblIssue.PK_Iss ueID)
FK_AreaID (foreign key linked to tblArea.PK_Area ID)

I'm trying to design a form for adding/editing Issues that will list
all AreaNames with a checkbox next to each, so that the user can mark
which AreaNames are associated with the issue he's adding/editing.
I've tried creating a subform, but with subform Master/Child links
being one-to-one relationships, I can't figure out how I'd be able to
have all AreaNames available.

I know I could do it the hard way without a subform, by dynamically
recreating the main form every time it's opened, looping through each
value in tblArea to create the checkboxes and labels, looping through
tblIssueArea to set the proper value of each checkbox, then running
Append/Delete queries on tblIssueArea for each time one of the
checkbox values changes. But I've gotta think there's an easier way!

Thanks in advance for any suggestions..
Your statement "I've tried creating a subform, but with subform
Master/Child links being one-to-one relationships.. ." doesn't compute.

Usually you have a single record associated with the Many...the Many
side displayed in a datasheet or continuous form.

Now you are correct that your can't use the typical property sheet
setting on a many-2-many/continuous-2-continuos form style. This is
where you can use the OnCurrent event of a form (or some other event)
and the use of the Filter/FilterOn keywords.

I'm assuming you have a main form, and 2 subforms containing the
continuous/datasheets.

For example, you might have
Private Sub Form_Current()
Forms!MainForm! OtherFormName.F orm.Filter = _
"AreaID = " & Me.AriaID
Forms!MainForm! OtherFormName.F orm.FilterOn = True
End Sub

Or you could create a text box called AreaID, visible false, in the main
form. And in the other subform's recordset have something like
Private Sub Form_Current()
Forms!Main!Area ID = Me.AreaID
"AreaID = " & Me.AriaID
Forms!MainForm! OtherFormName.F orm.Requery
End Sub

Maybe this will point you to a method you can use.
Jun 8 '07 #2
On Jun 8, 2:03 pm, salad <o...@vinegar.c omwrote:
Robert McEuen wrote:
Using A2K3, Windows XP
I'm handling a many-to-many relationship with a linking table
structure as follows (irrelevant fields omitted):
tblIssue
PK_IssueID (autonumber, primary key)
IssueName (text)
tblArea
PK_AreaID (autonumber, primary key)
AreaName (text)
tblIssueArea
PK_IssueAreaID (autonumber, primary key)
FK_IssueID (foreign key linked to tblIssue.PK_Iss ueID)
FK_AreaID (foreign key linked to tblArea.PK_Area ID)
I'm trying to design a form for adding/editing Issues that will list
all AreaNames with a checkbox next to each, so that the user can mark
which AreaNames are associated with the issue he's adding/editing.
I've tried creating a subform, but with subform Master/Child links
being one-to-one relationships, I can't figure out how I'd be able to
have all AreaNames available.
I know I could do it the hard way without a subform, by dynamically
recreating the main form every time it's opened, looping through each
value in tblArea to create the checkboxes and labels, looping through
tblIssueArea to set the proper value of each checkbox, then running
Append/Delete queries on tblIssueArea for each time one of the
checkbox values changes. But I've gotta think there's an easier way!
Thanks in advance for any suggestions..

Your statement "I've tried creating a subform, but with subform
Master/Child links being one-to-one relationships.. ." doesn't compute.

Usually you have a single record associated with the Many...the Many
side displayed in a datasheet or continuous form.

Now you are correct that your can't use the typical property sheet
setting on a many-2-many/continuous-2-continuos form style. This is
where you can use the OnCurrent event of a form (or some other event)
and the use of the Filter/FilterOn keywords.

I'm assuming you have a main form, and 2 subforms containing the
continuous/datasheets.

For example, you might have
Private Sub Form_Current()
Forms!MainForm! OtherFormName.F orm.Filter = _
"AreaID = " & Me.AriaID
Forms!MainForm! OtherFormName.F orm.FilterOn = True
End Sub

Or you could create a text box called AreaID, visible false, in the main
form. And in the other subform's recordset have something like
Private Sub Form_Current()
Forms!Main!Area ID = Me.AreaID
"AreaID = " & Me.AriaID
Forms!MainForm! OtherFormName.F orm.Requery
End Sub

Maybe this will point you to a method you can use.

Thanks for your reply, Salad.

Sorry about the confusion with my Master/Child statement. What I was
getting at is that the link can't be the equivalent of an outer join.
So, in the case of my situation, if Issue 1 is associated with Areas
1, 2, and 5, a subform based on tblIssueArea would only show Areas 1,
2, and 5. What I'm trying to achieve is to have Areas 1, 2, 3, 4, and
5 visible with checkboxes next to each, with the checkboxes next to
Areas 1, 2, and 5 checked and those next to 3 and 4 unchecked.

The setup I initially envisioned was a main form based on tblIssue and
one subform (continuous, linked on PK_IssueID=FK_I ssueID) based on
tblIssueArea, or based on a query joining tblIssueArea and tblArea.

Unfortunately, the filtering idea doesn't work for the same reason
subform isn't working - neither allows for Areas 3 and 4 (in this
example) to be available.

Does that make more sense?

Jun 8 '07 #3
Robert McEuen wrote:
On Jun 8, 2:03 pm, salad <o...@vinegar.c omwrote:
>>Robert McEuen wrote:
>>>Using A2K3, Windows XP
>>>I'm handling a many-to-many relationship with a linking table
structure as follows (irrelevant fields omitted):
>>>tblIssue
PK_IssueID (autonumber, primary key)
IssueName (text)
>>>tblArea
PK_AreaID (autonumber, primary key)
AreaName (text)
>>>tblIssueAr ea
PK_IssueArea ID (autonumber, primary key)
FK_IssueID (foreign key linked to tblIssue.PK_Iss ueID)
FK_AreaID (foreign key linked to tblArea.PK_Area ID)
>>>I'm trying to design a form for adding/editing Issues that will list
all AreaNames with a checkbox next to each, so that the user can mark
which AreaNames are associated with the issue he's adding/editing.
I've tried creating a subform, but with subform Master/Child links
being one-to-one relationships, I can't figure out how I'd be able to
have all AreaNames available.
>>>I know I could do it the hard way without a subform, by dynamically
recreating the main form every time it's opened, looping through each
value in tblArea to create the checkboxes and labels, looping through
tblIssueAr ea to set the proper value of each checkbox, then running
Append/Delete queries on tblIssueArea for each time one of the
checkbox values changes. But I've gotta think there's an easier way!
>>>Thanks in advance for any suggestions..

Your statement "I've tried creating a subform, but with subform
Master/Child links being one-to-one relationships.. ." doesn't compute.

Usually you have a single record associated with the Many...the Many
side displayed in a datasheet or continuous form.

Now you are correct that your can't use the typical property sheet
setting on a many-2-many/continuous-2-continuos form style. This is
where you can use the OnCurrent event of a form (or some other event)
and the use of the Filter/FilterOn keywords.

I'm assuming you have a main form, and 2 subforms containing the
continuous/datasheets.

For example, you might have
Private Sub Form_Current()
Forms!MainForm! OtherFormName.F orm.Filter = _
"AreaID = " & Me.AriaID
Forms!MainForm! OtherFormName.F orm.FilterOn = True
End Sub

Or you could create a text box called AreaID, visible false, in the main
form. And in the other subform's recordset have something like
Private Sub Form_Current()
Forms!Main!Area ID = Me.AreaID
"AreaID = " & Me.AriaID
Forms!MainForm! OtherFormName.F orm.Requery
End Sub

Maybe this will point you to a method you can use.

Thanks for your reply, Salad.

Sorry about the confusion with my Master/Child statement. What I was
getting at is that the link can't be the equivalent of an outer join.
So, in the case of my situation, if Issue 1 is associated with Areas
1, 2, and 5, a subform based on tblIssueArea would only show Areas 1,
2, and 5. What I'm trying to achieve is to have Areas 1, 2, 3, 4, and
5 visible with checkboxes next to each, with the checkboxes next to
Areas 1, 2, and 5 checked and those next to 3 and 4 unchecked.

The setup I initially envisioned was a main form based on tblIssue and
one subform (continuous, linked on PK_IssueID=FK_I ssueID) based on
tblIssueArea, or based on a query joining tblIssueArea and tblArea.

Unfortunately, the filtering idea doesn't work for the same reason
subform isn't working - neither allows for Areas 3 and 4 (in this
example) to be available.

Does that make more sense?
Not really. I envision Main form. It has 2 subforms; subform for area
checking, subform of areas that were checked. I probably would have a
filter on the areas checked set to "" initially (or on Open). Then have
a command button to set the filter once area records are checked.

I do something similar and the filter statement should/will work.
Jun 10 '07 #4

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

Similar topics

1
4054
by: mksql | last post by:
As an example, I am building an authentication mechanisim that will use data in the 3 left tables to determine rights to objects in a destination table, diagrammed below. In this structure, multiple records in the left tables will point to multiple records in the right table. Normally, I would approach this problem using junction tables (LeftID, RightID) to create many-to-many joins. However, given the structure of each table is nearly...
2
2995
by: j.mandala | last post by:
This had got to be something obvious that I am too blind to see! Funny problem: one of my users has my application linked to a SQL Server Backend. Front end it Access XP (SP3). The first form opened is full of (about 25) buttons with a few fields on the form footer that are filtered simply. It is called 'Switchboard' though it is not a standard MS Access Switchboard. This person did the following: Lengthened 2 strings from a table not...
4
7017
by: Dave Boyd | last post by:
Hi, I have two very similar forms each with a subform. The main form gets a few fields from the user and passes this back to a query that the subform is bound to. The requery is done when the user enters the last qualifying field on the main form. In one case this works fine, the subform shows the data the user wants to update -- which means showing all the data put in previously (ie showing this via the requery and the continuous...
6
2482
by: skgolden | last post by:
My husband and I own a small temporary labor company and deal with 4 major clients (A,B,C & D), each of which has about 2 dozen units in our tristate area that we deal with (ie, Company A, units a,b,c,d,e etc). We send temps possessing various skills (cashier, cook, hostess, etc) to the individual units as needed. What I'm trying to do is create a schedule we can use each day, for example: Monday, June 1, 2004 Company A, unit e Alice...
1
2154
by: NBruch | last post by:
Ok let me explain what im trying to do: i need a combo box which needs to be linked to a listbox (or combo box doesnt matter which really) then the listbox should bring up the record in a subform. so you pick a name (in the combo box in the main form) then it should bring up all the dates for which the person has a record for (in the list box or combo box) and then once you pick a date it should bring up the specific record you want...
2
5059
by: filbennett | last post by:
Hi Everyone, I'm generally unfamiliar with Access form design, but have programmed Cold Fusion applications for a couple of years. I'd like to build a data entry form in Access that allows the following. First, the data schema: Three tables are involved. The first is a PERSONS table which has two fields, SSNUMBER (primary key), and NAME.
13
3457
by: eighthman11 | last post by:
using Access 2003 and sql server version 8.0 Hey everyone. Created a text box where the user types in an Inventory number and it takes them to that inventory number on the contimuous form. The form is based on a link table to sql server. Here is the code: Dim rst As DAO.Recordset Dim InventoryItem As String InventoryItem = "'" & "TextBoxValue" & "'"
2
2145
by: johnplayboy07 | last post by:
hi, please i need support. i design a Registration form in frontpage 2003 and then design a table in SQL server 2000 database, now i want the data entries that will be filled on the form to be stored on my created SQL database. i dont know how to link the form to the SQL server. kindly help, i need the ASP code for the linking and how to go about it. thanks. john olufemi
4
1754
by: gnewsacct1 | last post by:
I was going to design a simple movie database, but I'm just stuck in the very begining. It will contain the following information. Country, Movie, Plot, Actors So, I created tables like below.
0
9894
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9679
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9676
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8542
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7078
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4955
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5156
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3141
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2508
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.