Creating a simple form?

Locker

New member
Local time
Today, 02:02
Joined
Jul 30, 2008
Messages
1
Hi All,

I'm new here, and am a bit of an Access novice.

I've been working on a database which records incidents that occur at my workplace. I have two main tables: "Incident" and "IncidentDetails".

The "Incident" table holds generic information on the incident, such as the type of incident it was, the location and the time/date it occured.

The "IncidentDetails" table, on the other hand, stores more specific information such as the person effected by the incident, how they were affected, what exactly happened, etc.

The idea is that if more than one person is affected by an incident, then two "IncidentDetails" records are created, which are both linked to a single record in the "Incident" table - I hope that makes sense.

So, my question is:

I've created a form for this information to be inputted. I've dragged in the fields from the "Incident" table and added a label above it saying "Incident Overview:". Below this, I want another section titled: "Incident Details:" - obviously with fields corrosponding to the "IncidentDetails" table. I belive this needs to be done using a sub form.

I also need the "IncidentDetails" part of the form to automatically use the ID of the "Incident" part of the form, as it's foreign key. This will link them together.

I'm using Access 2007 and guidence on how to achive this would be greatly appreciated :)
 
You're on the right track - create a second form which will be your subform with all the fields (including the parent's key) in the query and save it. Then open the first form and drag the second form onto it. Since both queries will have the first form's ID, Access will know the link between them. If not, click on the outermost edge of the subform and go to properties and check the linking fields.

There is a lot of help out there on this scenario since it is very basic to all databases.
 

Users who are viewing this thread

Back
Top Bottom