Query combination for form and subform

phs

New member
Local time
Today, 15:26
Joined
Aug 10, 2011
Messages
4
In Access 2007, I have been attempting to create a database that displays the events that people have participated in.

In this database I have two tables:
- the first contains the information about the individual (i.e., name, phone number)
- the second is related to the first through a one (1st table) to many(2nd) relationship
- it displays the events that people have participated in and when the events took place
when displaying the information, attempted to convey the one to many relationship by using a subform. Both the form and the subform run off of the same query, but require different inputs (i have to enter the same information in twice). I would like to know if its possible for me to cause the form and the subform to rely off of the same input (such that I only have to enter the information in once).

Also, my subform is not allowing me to create new fields. I was able to add data using the subform when I first created it, but now I am unable to. Is there a way to fix this?

Please note: I am new to Access and do not understand the syntax or logic of SQL and Visual basic. Also, any could you please define any tech terms that you use since this is one of the first times I have created a database.
 
Make sure you are opening your form in Design View for a start, not Layout view.

I would split your query into two.

1 for personal details and 1 for what ever is in the 2nd table.

Then on the main form, record source use the personal details query.

subform, record source use the other query.

Link the child and master fields of the subform by ID personal query and FK personal query ID in second query.

ID
name

ID
personalID
details

Your link should be like in bold above. The second table should have a personalID field in which is the FK to the first table.
 
Thank you so much, I greatly appriceated the step by step instructions. I was able to get the form and subform to work correctly, and in the process, I some how solved the second issue.
 
Its all about your relationships.

Split your tables up for the data you need to store.

eg. personal table, details table, reference table etc...

Each form or subform should link to its own table/query and so on.

Dont' forget your PK in each table, then a FK as well in other tables that need to be linked to different tables.
 

Users who are viewing this thread

Back
Top Bottom