Help Synch..ing Two Forms

M

Marco

Hi Everyone
I am having a problem. I have a Form called "Customers" with a primary
key auto numbered as customerID

I have a second form with a one to many relationship to the first form
called "Contact" with a P-Key of ContactID with a foreign key
"CustomerID".

I want to place a command button on the "customers" form that will open
"Contact". Similar to the sample Data Base in Access for Contact
Management DB with the Call button at the bottom.

Here is my code....
Private Sub Open_Contact_Form_Click()
On Error GoTo Err_Open_Contact_Form_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Contact"

stLinkCriteria = "[CustomerID]=" & Me![CustomerID]
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Open_Contact_Form_Click:
Exit Sub

Err_Open_Contact_Form_Click:
MsgBox Err.Description
Resume Exit_Open_Contact_Form_Click

End Sub

When the Contact Form opens it is not syched with the first.... Can
someone tell me why???? I used the wizard in Access to create it.

Best Regards
Marco
www.classactinsurance.com
 
Top