View Full Version : linking table/form to a row in another table/form


janaynay
11-05-2009, 12:31 PM
Main form has two comand buttons "Contact Details" and "Action/Followup".
I need to tie the Action/Followup to the record entered on the Main Form.

User will enter data on main form > click Action/followup and complete the information on that form.

I have created a column in Action/Followup to store the Main record ID, but can't seem to link it properly. I assumed that is what I needed to do.

Eventually I will need to create reports that this will be useful for.:eek:

pbaldy
11-05-2009, 12:38 PM
This type of thing?

http://www.baldyweb.com/wherecondition.htm

janaynay
11-06-2009, 06:00 AM
DoCmd.OpenForm "Action Item Form", acNewRec, , , "Occurrence ID =" & Me.Occurence

I am receiving Type mismatch error. Help?

janaynay
11-06-2009, 06:53 AM
If I just create a relationship from Main primary key to action Item primary key will that link the information together so I can report off of it?

I want to enter data in main form click on Action/followup which I have opening to another form then enter information on that form which should directly relate to what was just entered on the main form.

pbaldy
11-06-2009, 08:00 AM
For starters, you have that in the wrong position (too many commas). Also, I would not think you'd want the acNewRec (plus it's in the wrong place, plus I'm not even sure it's a valid argument in OpenForm). Didn't the first form create the record, and the second form is opening that same record?