473,624 Members | 2,577 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Forms and Subforms: Master ID Key not carrying to linked Child ID Key

15 New Member
Hello again.

I have setup a master form linked to a subform (actually nested subforms, but the top level subform is the one giving me trouble.) When entering data, the forms all appear to work correctly, but the moment that you change the record in the parent/master form, the forms "lose" all of the data we enter from the subforms. Upon examination of the tables, I found that the master key is not being populated into the top level subform, so I suspect that the records are simply "disappeari ng" because it doesn't know to associate the previous records entered with that Master record.

Thanks.
Elaina
Jan 3 '07 #1
11 8118
elaina
15 New Member
Hello again.

I have setup a master form linked to a subform (actually nested subforms, but the top level subform is the one giving me trouble.) When entering data, the forms all appear to work correctly, but the moment that you change the record in the parent/master form, the forms "lose" all of the data we enter from the subforms. Upon examination of the tables, I found that the master key is not being populated into the top level subform, so I suspect that the records are simply "disappeari ng" because it doesn't know to associate the previous records entered with that Master record.

Thanks.
Elaina
Perhaps I should ask a question?
How do I make the child subform pull the Parent ID for the current/selected record?

Thanks.
Elaina
Jan 3 '07 #2
MMcCarthy
14,534 Recognized Expert Moderator MVP
Hello again.

I have setup a master form linked to a subform (actually nested subforms, but the top level subform is the one giving me trouble.) When entering data, the forms all appear to work correctly, but the moment that you change the record in the parent/master form, the forms "lose" all of the data we enter from the subforms. Upon examination of the tables, I found that the master key is not being populated into the top level subform, so I suspect that the records are simply "disappeari ng" because it doesn't know to associate the previous records entered with that Master record.

Thanks.
Elaina
Elaina

This sound more like a relationship problem. Do the records in the table behind the subform have a fully cascading relationship with the records in the table behind the main form. In other words is the foreign key in the subforms table being entered automatically when a new record is being added.

Mary
Jan 4 '07 #3
elaina
15 New Member
Elaina

This sound more like a relationship problem. Do the records in the table behind the subform have a fully cascading relationship with the records in the table behind the main form. In other words is the foreign key in the subforms table being entered automatically when a new record is being added.

Mary

I'm relieved that you asked that. I did check and it wasn't set correctly initially. I fixed that and it's still not working. Is there something that I need to do to refresh the forms to "apply" the change?

Thanks.
Jan 4 '07 #4
MMcCarthy
14,534 Recognized Expert Moderator MVP
I'm relieved that you asked that. I did check and it wasn't set correctly initially. I fixed that and it's still not working. Is there something that I need to do to refresh the forms to "apply" the change?

Thanks.
It depends on what changes you made. Check out the master/child properties on the subform object. Are they set to the field you think they should be.

Mary
Jan 4 '07 #5
elaina
15 New Member
It depends on what changes you made. Check out the master/child properties on the subform object. Are they set to the field you think they should be.

Mary
So here's the setup:

Master table: Movie
Child table: Occurrences
master/ child link are both m_id ( unique key in Movie and 1 to many relationship and cascading references are selected)

Here's what I'm trying to do:

A data entry person opens the form and selects a record they wish to work on based on a "coder" field. They only have access to change the data in one field. All the others should choose which movie they are working on.

The occurrences subform should allow the data entry person to add records to the Occurrences table and related them by m_id.

After additional troubleshooting :

Seems like my master table may be trying to create a brand new record instead of selecting an existing record. I put in a Requery statement Onchange for one of the fields on the Mater form and it gives an error (unique key cannot be null). Sounds like a new record... What have I done.

Thanks.
Elaina
Jan 4 '07 #6
MMcCarthy
14,534 Recognized Expert Moderator MVP
So here's the setup:

Master table: Movie
Child table: Occurrences
master/ child link are both m_id ( unique key in Movie and 1 to many relationship and cascading references are selected)

Here's what I'm trying to do:

A data entry person opens the form and selects a record they wish to work on based on a "coder" field. They only have access to change the data in one field. All the others should choose which movie they are working on.

The occurrences subform should allow the data entry person to add records to the Occurrences table and related them by m_id.

After additional troubleshooting :

Seems like my master table may be trying to create a brand new record instead of selecting an existing record. I put in a Requery statement Onchange for one of the fields on the Mater form and it gives an error (unique key cannot be null). Sounds like a new record... What have I done.

Thanks.
Elaina
If you have a movie record that currently has no occurances what shows in the occurances subform?

Has Occurances got it's own primary key and is this an autonumber?

Is m_id showing on the subform?
Jan 4 '07 #7
elaina
15 New Member
If you have a movie record that currently has no occurances what shows in the occurances subform?

Has Occurances got it's own primary key and is this an autonumber?

Is m_id showing on the subform?
Nothing shows in the Occurrences subform. The occurrences subform does have it's own primary key and it is an autonumber. The m_id is not showing on the subform. I didn't originally put it in because the coders down need to know what it is. I added it for troubleshooting purposes.

But I think that the master form is creating a new record in the movie table instead of selecting the record associated with the movie that the data entry people are working on.

Thank you.
Elaina
Jan 5 '07 #8
MMcCarthy
14,534 Recognized Expert Moderator MVP
Nothing shows in the Occurrences subform. The occurrences subform does have it's own primary key and it is an autonumber. The m_id is not showing on the subform. I didn't originally put it in because the coders down need to know what it is. I added it for troubleshooting purposes.

But I think that the master form is creating a new record in the movie table instead of selecting the record associated with the movie that the data entry people are working on.

Thank you.
Elaina
How is the master form being opened?

Sorry Elaina but I'm getting more not less confused about what is going on.

Mary
Jan 5 '07 #9
elaina
15 New Member
How is the master form being opened?

Sorry Elaina but I'm getting more not less confused about what is going on.

Mary
The main/master form is just opened from the main access window. Double click on the form title and it just opens with the occurrences subform. Tell me if this helps:

Table name: Movie

Fields: Function On form:
Movie name bounded combo box
m_id (unique key) not required for data entry people to see
review type not editable
review status editable

So, when the DE people select a new movie name from the bounded combo box, instead of selecting that record with all of the associated data from the movie table, it's trying to create a new record with the movie name that the DE person selected. Before I made the m_id a unique key, it was actually creating the new record with a blank m_id, now it's giving me an error that the unique key can not be null.

Sorry for the confusion. Hope this helps you help me. :)

Elaina
Jan 5 '07 #10

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

Similar topics

1
2245
by: John Mudd | last post by:
I come from the Access environment where all the windows form handles were hidden so pardon my question. In Access I could make "continuous" subforms and there was a subform "container" object I could place on a form and then reference the subform and easily link the two together with a master/child link. The mastery of just how it worked was hidden from the average user. I have the dataset side working fine with multiple
2
4760
by: Ed Havelaar | last post by:
Hi, Hope someone can help. Here's the scenario: I have two MSAccess tables MainTab and SubTab. MainTab has an autonumber 'id' column as primary key. Subtab has this id column as a foreign key. There is a one-to-many relationship defined on MainTab and Subtab using the id column. The join type is include all from MainTab and only rows with matching value from SubTab. Referential integrity enforced; cascading
8
3086
by: Zlatko Matić | last post by:
Hello. How can I synchronize subforms content with current record in master form, if both form and subform are based on DAO code ? I assigned DAO recordset to forms by using QueryDef, on Load event. Thanks...
1
2802
by: santociabattari | last post by:
Hi Folks, I have 3 forms I want to link, so that when I advance 1 record in one form it will update the other two with the same record in the first form. I have tried using the form wizard (I am not an Access pro), but when I add the fields of 3 tables the wizard balks. I have been told to use the link master, but it is greyed out when I try linking. I can use Access 2000 or 2003
7
4535
by: john | last post by:
In my form I have a master table and a details table linked 1xM. I can search through the whole parent table but I also like to be able to search through the child table fields to find parent records. Should I design a new form for this or can I somehow make this work in the same form. Thanks in advance, john
2
8382
by: darnel | last post by:
I have 4 hierarchical tables and want to display it all together as a form and 3 subforms, when subform displays (and allow to add/edit) only relevant items from each superior subform. Tables are: Clients --> linked thru id_client --> Orders --> linked thru id_order --> Licences --> linked thru id_licence --> Regkeys Access' Form Wizard allows only form + 2 subforms. I tried to create last subform and its link manually, but I'm not...
1
1743
by: nchin61 | last post by:
Hi everyone, I'm an access advanced-beginner, mainly self taught and I'm building a fairly simple parent/child database. I have a table of companies, and a table of contacts at those companies linked by the CompanyID. I have a master form displaying company info and then a subform showing all the contacts at that company. I know how to search the master form for a particular company and display that record, and I presume it would be...
0
1377
by: sparks | last post by:
I was using this to swap out a form with subforms on it by just making a copy and tying each to copy of the same table. subformV1 tblVisit1 subformV2 tblVisit2 etc Select Case TabCtl0.Value Case 0: 'Initial Visit Child6.SourceObject = "subformV1"
3
2581
by: 6afraidbecause789 | last post by:
Think school - students - discipline interventions - misbehaviors - staff for this one....On a mainform frmStudentInterventions, I have linked a subform (sfrmMisbehaviors) with another subform (sfrmInterventions) with the Child and Master fields "InterventionID." This is tested and works - as users click through the continuous list of interventions, the continuous list of misbehaviors changes per intervention. Now, I need to link another...
0
8685
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
8633
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
8348
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
8493
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...
1
6112
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
5570
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
4084
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
4187
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2613
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.