G
Guest
Below is the code I am currently using to open a Report from a Form. I want
to know how I can use additional criteria. I want it to not only look at
CO_Number, but I want it to Match CO_LN_NO as well. Both of those fields
reside in the form, and both fields are in the same source table as CO_Number.
Thanks Tony
Public Function Serialization()
On Error GoTo Err_Command306_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = IIf([Cust_ID] = "07P071", "Premier Serialization",
IIf([Cust_ID] = "03F001", "Fulton Serialization", IIf([Cust_ID] Like "10*",
"Hicksgas Serialization", IIf([Cust_ID] = "07M021", "Myers Serialization",
"Marlo Serialization"))))
stLinkCriteria = "[CO_NUMBER]=" & "'" & Me![CO_NUMBER] & "'"
DoCmd.OpenReport stDocName, , , stLinkCriteria
Exit_Command306_Click:
Exit Function
Err_Command306_Click:
MsgBox Err.Description
Resume Exit_Command306_Click
to know how I can use additional criteria. I want it to not only look at
CO_Number, but I want it to Match CO_LN_NO as well. Both of those fields
reside in the form, and both fields are in the same source table as CO_Number.
Thanks Tony
Public Function Serialization()
On Error GoTo Err_Command306_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = IIf([Cust_ID] = "07P071", "Premier Serialization",
IIf([Cust_ID] = "03F001", "Fulton Serialization", IIf([Cust_ID] Like "10*",
"Hicksgas Serialization", IIf([Cust_ID] = "07M021", "Myers Serialization",
"Marlo Serialization"))))
stLinkCriteria = "[CO_NUMBER]=" & "'" & Me![CO_NUMBER] & "'"
DoCmd.OpenReport stDocName, , , stLinkCriteria
Exit_Command306_Click:
Exit Function
Err_Command306_Click:
MsgBox Err.Description
Resume Exit_Command306_Click