G
Guest
I'm trying to open a form based on informaiton from another form. I have the
following code but I keep getting a Compile error. When I take out one of
the parameters it works fine but obviously does not give me the right record.
I want to find a ProjecNumber and a WorkOrderNumber (that is my primary key
combination).
My code is:
Private Sub Open_Invoice_Click()
On Error GoTo Err_Open_Invoice_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Work Order Invoice_Solo"
stLinkCriteria = "[ProjectNumber]=" & Me![ProjectNumber] And = "[Work
Order Number]=" & Me![Work Order Number]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Open_Invoice_Click:
Exit Sub
Err_Open_Invoice_Click:
MsgBox Err.Description
Resume Exit_Open_Invoice_Click
End Sub
Thanks
following code but I keep getting a Compile error. When I take out one of
the parameters it works fine but obviously does not give me the right record.
I want to find a ProjecNumber and a WorkOrderNumber (that is my primary key
combination).
My code is:
Private Sub Open_Invoice_Click()
On Error GoTo Err_Open_Invoice_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Work Order Invoice_Solo"
stLinkCriteria = "[ProjectNumber]=" & Me![ProjectNumber] And = "[Work
Order Number]=" & Me![Work Order Number]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Open_Invoice_Click:
Exit Sub
Err_Open_Invoice_Click:
MsgBox Err.Description
Resume Exit_Open_Invoice_Click
End Sub
Thanks