G
G
I am trying to use a command button on a form call up a report that is based
a query that requires one parameter [RMA NO] using docmd.OpenReport.
I want to pass the value of a field, RMA NO, on the form as the parameter
value.
The problem is that I run into a syntax error message or it just ignores the
where condition all together and brings up the criteria prompt from the
query design.
Any ideas
HERE IS THE CODE:
Dim stDocName As String 'variable to hold the Travel Card report name
Dim strCriteria As String 'variable to hold the RMA NO to pass to the
warranty repair table query
'use the first 8 chars of the part number in the form and call the
'TravelCardtoPrint Procedure
stDocName = TravelCardToPrint(Left(Me("Part Number"), 8))
strCriteria = "[RMA NO]=" & Forms![Warranty Repair Form]![RMA NO]
DoCmd.OpenReport stDocName, acPreview, ,strCriteria
a query that requires one parameter [RMA NO] using docmd.OpenReport.
I want to pass the value of a field, RMA NO, on the form as the parameter
value.
The problem is that I run into a syntax error message or it just ignores the
where condition all together and brings up the criteria prompt from the
query design.
Any ideas
HERE IS THE CODE:
Dim stDocName As String 'variable to hold the Travel Card report name
Dim strCriteria As String 'variable to hold the RMA NO to pass to the
warranty repair table query
'use the first 8 chars of the part number in the form and call the
'TravelCardtoPrint Procedure
stDocName = TravelCardToPrint(Left(Me("Part Number"), 8))
strCriteria = "[RMA NO]=" & Forms![Warranty Repair Form]![RMA NO]
DoCmd.OpenReport stDocName, acPreview, ,strCriteria