I have searched and not found a conclusive answer to this question.
I have two tables company(IDCompany unique key) and contact(IDContact unique key and IDCompany secondary key). I Select and enter companys in companyform when I have selected a company I press a button too go contactform, but I cant get IDCompany(in companyform) too connect the next contactform.
If I look at the code created it looks correct. But it they IDCompany is not transfer in the opened form.(As secondary question I would rather have the name than the IDcompany) Any suggestions... (Yes I have used access 2003 wizard)
Even tried using
in Form.open but then I get an error message saying that
"You can't assign value to this object"
I have two tables company(IDCompany unique key) and contact(IDContact unique key and IDCompany secondary key). I Select and enter companys in companyform when I have selected a company I press a button too go contactform, but I cant get IDCompany(in companyform) too connect the next contactform.
If I look at the code created it looks correct. But it they IDCompany is not transfer in the opened form.(As secondary question I would rather have the name than the IDcompany) Any suggestions... (Yes I have used access 2003 wizard)
Code:
Private Sub Command31_Click()
On Error GoTo Err_Command31_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Contacts"
stLinkCriteria = "[IDCompany]=" & Me![IDCompany]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command31_Click:
Exit Sub
Err_Command31_Click:
MsgBox Err.Description
Resume Exit_Command31_Click
End Sub
Even tried using
Code:
Me.IDCompany= Forms!companyform!IDCompany
"You can't assign value to this object"
Last edited: