Topics Search

Subforms : Creating Parent and Child Forms

Subforms : Creating Parent and Child Forms
Views: 571
A subform is a form that is placed in a parent form, called the main form. Subforms are particularly useful to display data from tables and queries that have one-to-many relationships. Learn: What is a subform? How to create a form and subform at once, how to use subform wizard and Drag-and-drop method.
Sponsored Links:

More topics

 

Parent/Child subform

Preview
I have 2 tables(1 parent 1 child). I would like to have the the conents of the parent and child side by side on a form. So I have two sub forms each bound to the parent and child tables. My problem is I only want the child table to display the data based on the selected row from the parent table. I can't put the child subform within the parent subform and I still have to be able to add new rows two both tables through this interface
 

A2007 ADP/SQL Parent Child form

Preview
Access 2007 ADP/ SQL Server 2005 BE / Win7 x64

Most of my app will have a lot of parent/child forms. My question is what is the best preferred method of first creating the parent record and obtain the ID and pass to the child datasheet record.

Just curious to see what I need to do before I spend a lot of wasted time on a wrong method.
 

MDI Parent - Child Form?

Preview
I'm working on a 3 tier payroll application.

I am suppose to open every child form into the parent form .I.e. if I click on any button to open a form, a new parent window with complete menus should open and in the middle the child form will be displayed. This should happen in case of opening any forms.

If I open an employee form, parent window should be displayed with it. likewise with all other forms.
 

Refreshing Parent Form when new record added via SubForm

Preview
I have a Parent-form containing two Sub-forms. Each sub-form updates records in their respective table as well as a shared table. The two ID fields in each sub-form are linked as "Child fields" to the Parent-form's "Master Fields".

The Parent form gets it's "Master Field" values from a Query. This query is based on the records updated by either of the two subforms. After I add a new record via one of the subforms, the Master fields on the Parent form do not update. The only way to get it to update is to close the Parent form altogether and then open it again.

I think what I need to be doing is adding something to "On Mouse Up" of the button, or even better, the "After Update" on one field in each of the subforms.
 

Need help with parent child query

Preview
I have a table as below. It only has one child level

ID | Name | | Parent
1 | KSP | | 0
2 | PSP | | 0
3 | HJI | | 1
4 | MXM | | 2

I want the output like : basically all parent should follow their child and order on parent name

ID | Name | | Parent
1 | KSP | | 0
3 | HJI | | 1
 

How do I query multiple fields, and sum them all up?

Preview
I have a table with transactions. The transactions are for both Parent companies and Child Companies.

I created another table with the Parent in one field, and all the child companies as other fields of the Parent record.

Can I use a query to sum all of the transactions for all of the child companies and the parent company, and combine them.

My goal: To sum all transactions from both parent and child companies within a data range.

I can do them all seperately, because I have all the company records(child and parent) as seperate records, in a Customer table, however I am having difficulty determining the best method for combining the parent and child company totals together
 

Set subform AllowEdits property from another form

Preview
When my form that contains two subforms is opened from certain other forms, I want to disallow edits on one of the subforms and on the parent.

Docmd.openForm "ParentName"
Forms!ParentName.AllowEdits=False
This only works for the parent-the subforms still allow edits (something that affects totals on the Parent)

I added:
Forms!ParentName.Form.Child2Name.AllowEdits=False

which gives me an error message.

I am using A2007 with W7.
 

Set subform AllowEdits property from another form

Preview
When my form that contains two subforms is opened from certain other forms, I want to disallow edits on one of the subforms and on the parent.
My code:

Docmd.openForm "ParentName"
Forms!ParentName.AllowEdits=False
This only works for the parent-the subforms still allow edits (something that affects totals on the Parent)

I added:
Forms!ParentName.Form.Child2Name.AllowEdits=False

which gives me an error message.

I am using A2007 with W7.

I know that I can open the whole form as read-only, but would like child1 to be available for editing. I have searched, and found things that I thought would apply, but am missing something.
 

On child form create bound list box to show related records from parent form

Preview
I have two tables with a many-to-many relationship which is causing many problems. My parent and child forms are linked via a junction table. I want to make it possible to create aread-only version of the child table so that you don't have to link to it from the parent table.

A form linking the two together has been created with a combobox where you can pick and choose which records relate to each other.

I'd like on the child form there to be a list box or combo box which shows the records from the parent table linked to that record from what is picked within the comboboxes of the "junction form".

In essense it would mean that people reading the child form would know which names the record is based on if they didn't want to go via the parent form to read it.
 

How to find the most recent inserted auto number is?

Preview
In one of the forms is a Parent / Child situation. The program inserts the parent then allows the children to be inserted or updated. The parent and children are related by an autonumber database table column called CustomerID. After a parent is inserted into the database I would like to find out what that autonumber ID is so I can use it for the child data.