Relationships and Forms

papadega3000

Registered User.
Local time
Today, 15:29
Joined
Jun 21, 2007
Messages
80
I have a issue where I have a relationship that is a one to many relationship that relates FieldX in TableA to FieldY in TableB. The problem I have is that I made separate forms that inputs data into the tables but it does not relate the two.
How can I make the forms establish the relationship?

TableA is the ,for lack of a better term, parent and TableB is the child.
You would input data in TableA's Form then proceed to the next form
My idea was to to have a drop down box that queries TableA and then you select the item you want to relate then enter the data into that form and then when you make a query the Field comes up with the related tasks.

How can I make this work. Do I need to write VBA or is there another way.
 
If you can have TableB as the RecordSource of a SubForm where TableA is the RecordSource of the MainForm and the LinkChild/MasterFields are set up correctly, then Access will maintain the related field for you.
 
Thank you for your post I got it working the way it was suppose to I wasn't setting it up properly. And I apologize for the delay in responding due to the holiday.

Thanks again for your help.
 
Another question related to this one is about establishing a relationship between 3 different tables. In this case I still have TableB in a subform and Table in the MainForm but can I nest another subform inside the subform of TableB to relate TableB to TableC.

My idea was have two separate forms the form for Table C and the form for TableA and TableB(which would be the mainform/subform) when you enter the data on the form before that you could just navigate to the record that was just entered with a query and then enter the other related data.

Can this be done?
 
I figured out a way...Using the TableB as a subform allows me to edit the relationship it has with the third tableC. I added buttons that switch DataEntry on/off and allows me to add a new record and then switch modes and go in and edit the new record.
 
Either you will need to insert the ForeignKey yourself with code or use the Form/SubForm approach talked about in this thread so Access can maintain the key for you.
 

Users who are viewing this thread

Back
Top Bottom