E
Emma Aumack
The following code opens a popup "Frm_LUComplianceHistory" form from a
Subform "Frm_LOCAct". stLinkCriteria1 matches account number fields in both
of these forms This works fine. Then stLinkCriteria2 is supposed to match
product category fields in the main form (LOC_Maintenance.txt_GrpProdCat) and
the popup form (Frm_LUComplianceHistory.Product). However, when I
doubleclick on cbo_LOCAct_AccountNo, I get an "Enter Parameter Value" dialog
box with the product category that it should be filtering on above the text
box. If I type in the product category in the text box and click ok, then
Frm_LUComplianceHistory opens with the appropriate records. If I don't put
anything in that text box. I get a blank Frm_LUComplianceHistory.
Why am I getting the Enter Parameter Value dialog? I think it might have
something to do with my quotation marks for stLinkCriteria2.
Private Sub LOCAct_AccountNo_DblClick(Cancel As Integer)
Dim stDocName As String
Dim stLinkCriteria1 As String
Dim stLinkCriteria2 As String
stDocName = "Frm_LUComplianceHistory"
stLinkCriteria1 = "[Account_Number] =" & Me![cbo_LOCAct_AccountNo]
stLinkCriteria2 = "[Product] =" & Me.Parent![txt_GrpProdCat]
DoCmd.OpenForm stDocName, acFormDS, , stLinkCriteria1 & "And" &
stLinkCriteria2, acFormReadOnly
Subform "Frm_LOCAct". stLinkCriteria1 matches account number fields in both
of these forms This works fine. Then stLinkCriteria2 is supposed to match
product category fields in the main form (LOC_Maintenance.txt_GrpProdCat) and
the popup form (Frm_LUComplianceHistory.Product). However, when I
doubleclick on cbo_LOCAct_AccountNo, I get an "Enter Parameter Value" dialog
box with the product category that it should be filtering on above the text
box. If I type in the product category in the text box and click ok, then
Frm_LUComplianceHistory opens with the appropriate records. If I don't put
anything in that text box. I get a blank Frm_LUComplianceHistory.
Why am I getting the Enter Parameter Value dialog? I think it might have
something to do with my quotation marks for stLinkCriteria2.
Private Sub LOCAct_AccountNo_DblClick(Cancel As Integer)
Dim stDocName As String
Dim stLinkCriteria1 As String
Dim stLinkCriteria2 As String
stDocName = "Frm_LUComplianceHistory"
stLinkCriteria1 = "[Account_Number] =" & Me![cbo_LOCAct_AccountNo]
stLinkCriteria2 = "[Product] =" & Me.Parent![txt_GrpProdCat]
DoCmd.OpenForm stDocName, acFormDS, , stLinkCriteria1 & "And" &
stLinkCriteria2, acFormReadOnly