E
Emma Aumack
Can someone tell me how to get this to work.
I have a subform that has an account_no field. When this field is double
clicked another form pop up and is filtered on the account_No.
But I want to do another filter on the records in the popup form based on a
field on the main form. How do I do this? I can get the first part to work
but I can't figure out how to get then 2nd part to work.
This is the code I have so far:
Private Sub cbo_LOCAct_AccountNo_DblClick(Cancel As Integer)
Dim stDocName As String
Dim stLinkCriteria1 As String
Dim stLinkCriteria2 As String
stDocName = "Frm_LUComplianceHistory"
stLinkCriteria1 = "[txt_Account_Number] =" & Me![cbo_LOCAct_AccountNo]
stLinkCriteria2 = "[txt_Product] =" & Me.Parent![txt_GrpProdCat]
DoCmd.OpenForm stDocName, acFormDS, , stLinkCriteria1 And
stLinkCriteria2, acFormReadOnly
End Sub
I keep getting a Type mismatch on the Docmd.Openform line. And I suspect it
has to do with the StLinkCriteria but I can't figure out how to get both sets
of criteria in my code.
Please help!!!
I have a subform that has an account_no field. When this field is double
clicked another form pop up and is filtered on the account_No.
But I want to do another filter on the records in the popup form based on a
field on the main form. How do I do this? I can get the first part to work
but I can't figure out how to get then 2nd part to work.
This is the code I have so far:
Private Sub cbo_LOCAct_AccountNo_DblClick(Cancel As Integer)
Dim stDocName As String
Dim stLinkCriteria1 As String
Dim stLinkCriteria2 As String
stDocName = "Frm_LUComplianceHistory"
stLinkCriteria1 = "[txt_Account_Number] =" & Me![cbo_LOCAct_AccountNo]
stLinkCriteria2 = "[txt_Product] =" & Me.Parent![txt_GrpProdCat]
DoCmd.OpenForm stDocName, acFormDS, , stLinkCriteria1 And
stLinkCriteria2, acFormReadOnly
End Sub
I keep getting a Type mismatch on the Docmd.Openform line. And I suspect it
has to do with the StLinkCriteria but I can't figure out how to get both sets
of criteria in my code.
Please help!!!