Friday
02-26-2004, 01:31 PM
Can anyone see what's wrong with this code?
+++++++++++++++++++++++++++++++++
Private Sub Command22_Click()
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "rptindvAudit"
stLinkCriteria = "fldAuditNumber =" & Me.txtAuditNumber
DoCmd.OpenReport stDocName, acViewPreview, , stLinkCriteria
End Sub
+++++++++++++++++++++++++++++++++
When the button is clicked, I get prompted for a value:
(see parm_error.jpg)
When I hover the mouse over the code the values are correct.
(see parm_error2.jpg)
The data source for the report is a query with no prompts built in. I run this same exact code on another form and it works fine. The only difference is on that example I am matching a value to a key field. In the above code, neither field is a key value. I am running AccessXP on an XP machine. Has anyone ran into this before?
+++++++++++++++++++++++++++++++++
Private Sub Command22_Click()
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "rptindvAudit"
stLinkCriteria = "fldAuditNumber =" & Me.txtAuditNumber
DoCmd.OpenReport stDocName, acViewPreview, , stLinkCriteria
End Sub
+++++++++++++++++++++++++++++++++
When the button is clicked, I get prompted for a value:
(see parm_error.jpg)
When I hover the mouse over the code the values are correct.
(see parm_error2.jpg)
The data source for the report is a query with no prompts built in. I run this same exact code on another form and it works fine. The only difference is on that example I am matching a value to a key field. In the above code, neither field is a key value. I am running AccessXP on an XP machine. Has anyone ran into this before?