Set form to be the ParentForm

G

Guest

I used the wizard to create two forms. Based on the one-to-many relationship
it decided which form was the parent form. I've switched the code in the
underlying modules and edited them accordingly. But where do I tell Access
which form is the Parent and which is the Child.

Thanks.
 
P

PC Datasheet

You don't! Access determines this on its own from the design of your tables
and the relationship between the tables. Access always creates the parent
form (main form) from the table on the one side of the relationship and the
child form (subform) from the table on the many side of the relationship.
The table on the one side is the table that has its primary key linked in
the relationship. The table on the many side is the table that has a foreign
key linked in the relationship. For example:

TblDepartment
DepartmentID
DepartmentName

TblEmployee
EmployeeID
DepartmentID
EmployeeName

DepartmentID (PK) in TblDepartment is linked to DepartmentID(FK) in
TblEmployee in the relationship. Access will automatically base the parent
form (main form) on TblDepartment and the child form (subform) on
TblEmployee. It can't be the other way even if you wanted!!!
 
G

Guest

Instead of my asking a specific question, let me make it general.

I have a table called SHARES and a table SHAREHOLDERS. Each shareholder can
have many shares. But the main form needs to be SHARES. Then if the user
wants to get address information, etc about the shareholder he can call up
the form SHAREHOLDER. How would you accomplish this?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top