Hi.
I'm a rookie to Access coding and have what is probably a simple problem for you all. I have a subform that I need to synchronize with its primary form on a field in that form. Here's the code:
Private Sub Command50_Click()
On Error GoTo Err_Command50_Click
Dim stDocName As String
Dim stLinkCriteria As Integer
stLinkCriteria = [ContactID]
stDocName = "Names"
DoCmd.OpenForm stDocName, , , [ContactID] = Me.ContactID
Exit_Command50_Click:
Exit Sub
Err_Command50_Click:
MsgBox Err.Description
Resume Exit_Command50_Click
End Sub
When I invoke the form load, I get all the contact names, and only want those pertinent to the company I'm currently working with. Thanks for your help as always.
I'm a rookie to Access coding and have what is probably a simple problem for you all. I have a subform that I need to synchronize with its primary form on a field in that form. Here's the code:
Private Sub Command50_Click()
On Error GoTo Err_Command50_Click
Dim stDocName As String
Dim stLinkCriteria As Integer
stLinkCriteria = [ContactID]
stDocName = "Names"
DoCmd.OpenForm stDocName, , , [ContactID] = Me.ContactID
Exit_Command50_Click:
Exit Sub
Err_Command50_Click:
MsgBox Err.Description
Resume Exit_Command50_Click
End Sub
When I invoke the form load, I get all the contact names, and only want those pertinent to the company I'm currently working with. Thanks for your help as always.