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

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

15
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 "disappearing" because it doesn't know to associate the previous records entered with that Master record.

Thanks.
Elaina
Jan 3 '07 #1
11 8095
elaina
15
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 "disappearing" 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 Expert Mod 8TB
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 "disappearing" 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
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 Expert Mod 8TB
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
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 Expert Mod 8TB
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
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 Expert Mod 8TB
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
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
MMcCarthy
14,534 Expert Mod 8TB
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
But it has to be on the subform and the main form or their is no relationship for the subform to the mainform. The controls can be invisible but they must be on the forms.

Mary
Jan 5 '07 #11
elaina
15
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

Shoot- formatting didn't carry over...

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
Jan 5 '07 #12

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

Similar topics

1
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...
2
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...
8
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...
1
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...
7
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...
2
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:...
1
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...
0
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...
3
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...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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...
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
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,...

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.