473,890 Members | 1,393 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Parent/Child Relationship / Access 2010

15 New Member
I have started creating a database (There is only one table as of now).
The database is meant to store information about "technical requirements" in an industry.
Each row corresponds to one requirement. It contains information such as description, verification method, etc regarding that specific requirement.

There is a field, "RID" (Requirement ID).
There are also two fields ("Parents", "Children") that are intended to indicate the parent/child relationship between these technical requirements.

I used the lookup wizard as "datatype" of these two fields (Parents, Children).
It gives the user the ability to see the list of RIDs of all rows (requirements) and choose multiple values for parents (or children).
In other words, there is a list of requirements and you can choose which requirements are parents of others.

Now here's what I would like to do:
I want to enable some automatic reciprocity.
When the user chooses Requirement 1 as parent of Requirement 2. I want Access to automatically show RID 2 in the "children" field of Requirement 1.

In other words I don't want the user to do everything twice when designating parent/child relationship.

I hope I have been clear/ if not I can explain further.
also, I will create more than one table if need be.
Jan 7 '13
17 13732
M0ji
15 New Member
@ Set Schrock

The other thing I tried:
I have a form that presents my data.
- I go to design view
- There is a combo box whose control source is Parent field
- I open the properties and go to the event tab
- Next to "after update" I click on ... (three dots)
- I click on code builder and I try your code, but I get a syntax error
Jan 8 '13 #11
M0ji
15 New Member
@ TheSmileyCoder

Oh, I guess I didn't answer your first question properly.
multiple children can have multiple parents.
so it would actually be scenario 3.

I am watching the video you posted, and it's great, but I don't think it answers all of my questions....I am watching it again.
Jan 8 '13 #12
TheSmileyCoder
2,322 Recognized Expert Moderator Top Contributor
The video has a part 2, I don't know if you have noticed.

However the treeview itself might not be relevant in your case, since when multiple parents have multiple children, you need a linking table, and the treeview is not strictly a many-many kind of thing, at least you run the risk of accidentally creating a never ending loop. Of course this can be prevented through code.


When you have the link table in place, you can have a continues subform to allow for selection of children requirements, and likewise have a continues subform, to show parent requirements. That way access will handle all the updates in its standard way, and saves you any code.
Jan 8 '13 #13
Seth Schrock
2,965 Recognized Expert Specialist
In the control that you enter the Parent ID, put my code in the After_Update event.
Jan 8 '13 #14
M0ji
15 New Member
Smiley

so basically, if I understood right, you are only going to give the user the ability to determine the children for every row (requirement) and have the parent field generated based on that selection correct?
Jan 8 '13 #15
M0ji
15 New Member
What I ended up doing which works perfectly was using a sub-form.
Since I had never used a sub-form before, I didn't know that it was the key to this problem
Jan 9 '13 #16
TheSmileyCoder
2,322 Recognized Expert Moderator Top Contributor
In the application I made, each child req. would only have 1 parent. The reqs could be moved around through drag and drop.

Furthermore links could be made to other reqs (using a linking table), allthough in this case there was no definition of which was the parent and which was the child. It would have been easy to implement if requested.
Jan 9 '13 #17
mshmyob
904 Recognized Expert Contributor
I have been sitting on this little bit of sample code for awhile now as I intended to do a Bytes artice for it but never got around to it.

This proof of concept code show how you can create an unbalanced infinite depth hierachy with a single table using the Adjacency List Model.

I show how you can use the Treeview to display the hiearchy and also how to create a dynamic SQL query to do the same.

Remember that this is proof of concept.

It may be of some help.

regards,
Attached Files
File Type: zip hierarchy.zip (37.8 KB, 453 views)
Jan 10 '13 #18

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1258
by: steroche | last post by:
Hi, I need to write an Application that shows related tables(possibly >2) in the same dataset. I also need the capability to edit data and save it back to the SQL db.This editing may be done on the same page within the dataset or alternatively edit the data on a new page(whichever is easier or less hassle!) Anybody have a suggestion as to the best easiest way to accomplish this? Thanks in advance, Steve
0
1243
by: Steve | last post by:
I have mixed managed/unmanaged C++ MFC application. The mainframe is MFC window and we added new managed form. How can I set parent/child relationship between the new managed form (System::Windows::Forms::Form) and old mainframe (CWnd derived)? Thanks. Steve
3
5894
by: B-Dog | last post by:
I'm trying to comprehend the database features in VB and after tons of reading I'm not sure how do relationships. I want to display a parent column and the respective child columns on one line of a datagrid. For example, Employee table and Employee Details table I'd like to display the employee name and their details on one line of a datagrid, without having to have the "hyperlink" to the employee details like I'd seen. Can anyone give...
2
6048
by: RJN | last post by:
Hi I need help in writing a recursive function. My table structure is as below. InstanceId LevelId ParentId 100 1 null 101 2 100 102 3 101 103 4 102
3
11391
by: reachsamdurai | last post by:
Is it possible to determine the list of child/parent tables for a particular table from any system catalog tables? Using the syscat.tables I'm able to retrieve the no of dependent parent/child tables but unable to determine the list of dependent table name(s) Example : For a simple department-employee relationship, the following query gives the count of parent/child tables but not the table names(s). db2 => select tabname,...
0
954
by: CodeMonkey | last post by:
I'm using Visual Studio 2005 (vb.net). I have a dataset with 3 tables in it. I have a main table that has two fields in it, Category and Subcategory. I also have two other tables, one for the different categories and one for the subcategories. Subcategories are related to the Categories. They are supposed to select a main Category, and then a Subcategory.
3
18724
by: creative1 | last post by:
Here is how you create a complex data report that involves parent and child commands and you can update information at runtime. Its pretty straight forward to work with simple queries; however, working with complex reports is tricky Assumption: Reader of this article have basic knowledge of creating data reports. Creating a Parent-Child Command and create a DataReport Suppose we have a database called company with two tables ...
0
1103
by: vivajay | last post by:
I'm trying to do a parent/child relationship in nested datalists I have created. I do not want to repeat the contract number for each asset that falls within that contract number when I display each one on the web page. The fields are all coming from the same table from the same stored proc. Also, I cannot do two separate stored procs for the parent and child tables. I tried to do a relation on the same table and it throws an error 'ParentKey...
1
3153
by: Alex Benitez | last post by:
I want to have a form with 2 subforms...1 subform would be the parent table...and the 2nd subform would be the child table and they both would be in datasheet view. I want to see all records in the parent table and when I select a different record it would only show me the records in the child table/datasheet that is related. What is the best way of accomplishing this? Any samples out there?
0
9979
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, weíll explore What is ONU, What Is Router, ONU & Routerís main usage, and What is the difference between ONU and Router. Letís take a closer look ! Part I. Meaning of...
0
11234
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
10829
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
10925
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
10468
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7171
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5854
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
6058
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4276
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.