adding data to related table using form - access noob.

technohead

New member
Local time
Today, 15:10
Joined
Apr 27, 2009
Messages
8
adding record to related table using form - access noob.

Hi there, apologies if this question is a bit basic, I have searched for the answer to this question, and im sure it must be out there but i've had no luck after searching for quite a while.

How do you add data to a related table using a form?

I can add the record fine in the table (clicking the '+' sign at the side of the record brings a drop down with the empty fields to populate the related table)

However I was unsure of how to do this using forms. There is no '+' when i create a form for the parent table.

So for example my parent table (FrmVisitDetails) has 'VisitID' (Autonumber) as the primary key. And the child table (FrmWrkDetails) has 'VisitID' as primary key (number) I want to be able to add a record into FrmWrkDetails once FrmVisitDetails has been populated. I know you could do it as a subform on the original form, but I want them both on seperate forms as there are a lot of fields.

Thanks
Sean
 
Last edited:
Well, you will need to create some sort of "Edit" button and when that is clicked, you will bring up the for "frmWrkDetails" filter based on the parent ID (VisitID). The "Default" value for VisitID on the frmWrkDetails should be set to the parent form VisitID.
 
Well, you will need to create some sort of "Edit" button and when that is clicked, you will bring up the for "frmWrkDetails" filter based on the parent ID (VisitID). The "Default" value for VisitID on the frmWrkDetails should be set to the parent form VisitID.

Cheers, I have added a simple open form command button.

One very Annoying thing though, when you click on the open form button, it opens the FrmWrkDetials on a random record. You then have to edit the VisitID number to match the primary key in FrmVisitDetials. Is there away of opening the form so it opens on a blank form with the visit ID's matching?

Thanks
 

Users who are viewing this thread

Back
Top Bottom