Enter Parameter Value Error

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
 
D

Douglas J. Steele

You need spaces on either side of the AND connector:

DoCmd.OpenForm stDocName, acFormDS, , stLinkCriteria1 & " And " &
stLinkCriteria2, acFormReadOnly
 
E

Emma Aumack

Still getting the Enter paramater value dialog box.

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 = "[Account_Number] =" & Me![cbo_LOCAct_AccountNo]
stLinkCriteria2 = "[Product] =" & Me.Parent![txt_GrpProdCat]

DoCmd.OpenForm stDocName, acFormDS, , stLinkCriteria1 & " And " &
stLinkCriteria2, acFormReadOnly

End Sub
--
www.bardpv.com
Tempe, Arizona


Douglas J. Steele said:
You need spaces on either side of the AND connector:

DoCmd.OpenForm stDocName, acFormDS, , stLinkCriteria1 & " And " &
stLinkCriteria2, acFormReadOnly


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Emma Aumack said:
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
 
D

Douglas J. Steele

What are the data types of Account_Number and Product? If they're text, then
you need to enclose the values in quotes:

stLinkCriteria1 = "[Account_Number] =""" & Me![cbo_LOCAct_AccountNo] &
""""

(that's three double quotes in front, and four double quotes after), or

stLinkCriteria1 = "[Account_Number] ='" & Me![cbo_LOCAct_AccountNo] & "'"

Exagerated for clarity, that's

stLinkCriteria1 = "[Account_Number] = ' " & Me![cbo_LOCAct_AccountNo] & "
' "

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Emma Aumack said:
Still getting the Enter paramater value dialog box.

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 = "[Account_Number] =" & Me![cbo_LOCAct_AccountNo]
stLinkCriteria2 = "[Product] =" & Me.Parent![txt_GrpProdCat]

DoCmd.OpenForm stDocName, acFormDS, , stLinkCriteria1 & " And " &
stLinkCriteria2, acFormReadOnly

End Sub
--
www.bardpv.com
Tempe, Arizona


Douglas J. Steele said:
You need spaces on either side of the AND connector:

DoCmd.OpenForm stDocName, acFormDS, , stLinkCriteria1 & " And " &
stLinkCriteria2, acFormReadOnly


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Emma Aumack said:
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
 
E

Emma Aumack

That did it!

stLinkCriteria2 = "[Product] ='" & Me.Parent![txt_GrpProdCat] & "'"

Thank you so much. I always have trouble with quotes!
--
www.bardpv.com
Tempe, Arizona


Douglas J. Steele said:
What are the data types of Account_Number and Product? If they're text, then
you need to enclose the values in quotes:

stLinkCriteria1 = "[Account_Number] =""" & Me![cbo_LOCAct_AccountNo] &
""""

(that's three double quotes in front, and four double quotes after), or

stLinkCriteria1 = "[Account_Number] ='" & Me![cbo_LOCAct_AccountNo] & "'"

Exagerated for clarity, that's

stLinkCriteria1 = "[Account_Number] = ' " & Me![cbo_LOCAct_AccountNo] & "
' "

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Emma Aumack said:
Still getting the Enter paramater value dialog box.

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 = "[Account_Number] =" & Me![cbo_LOCAct_AccountNo]
stLinkCriteria2 = "[Product] =" & Me.Parent![txt_GrpProdCat]

DoCmd.OpenForm stDocName, acFormDS, , stLinkCriteria1 & " And " &
stLinkCriteria2, acFormReadOnly

End Sub
--
www.bardpv.com
Tempe, Arizona


Douglas J. Steele said:
You need spaces on either side of the AND connector:

DoCmd.OpenForm stDocName, acFormDS, , stLinkCriteria1 & " And " &
stLinkCriteria2, acFormReadOnly


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top