Hi,
I have 2 forms and both have one common field. I am trying to have a button on one of the forms which opens up the other form with information relevent to the record i am currently viewing, as im runing Access with SQL tables, the wizard doesnt seem to work.
Here is the code i have at the moment:
Private Sub Command141_Click()
On Error GoTo Err_Command141_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "co4"
stLinkCriteria = "[Delivery_SigRef]=" & Me![Delivery_SigRef]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command141_Click:
Exit Sub
Err_Command141_Click:
MsgBox Err.Description
Resume Exit_Command141_Click
End Sub
I get the error 'Invalid Column Name 'Fieldcontents''
Does any one have any ideas how i could make this button work with my forms?
Thanks!!
James
I have 2 forms and both have one common field. I am trying to have a button on one of the forms which opens up the other form with information relevent to the record i am currently viewing, as im runing Access with SQL tables, the wizard doesnt seem to work.
Here is the code i have at the moment:
Private Sub Command141_Click()
On Error GoTo Err_Command141_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "co4"
stLinkCriteria = "[Delivery_SigRef]=" & Me![Delivery_SigRef]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command141_Click:
Exit Sub
Err_Command141_Click:
MsgBox Err.Description
Resume Exit_Command141_Click
End Sub
I get the error 'Invalid Column Name 'Fieldcontents''
Does any one have any ideas how i could make this button work with my forms?
Thanks!!
James