Hi,<br>
I'm trying to open a report in VBA and am having trouble with the filtering syntax. I appear to be opening the report ok, but I'm seeing parameter dialog boxes with the filter criteria that I'm trying to specify as the prompt. Code is as follows:<br>
<br>
Private Sub Label20_Click()<br>
Dim stCriteria, BatchNo As String<br>
BatchNo = Me![Batch Number]<br>
stCriteria = "[Batch Number] =" & BatchNo<br>
DoCmd.OpenReport "Certificate of Analysis", acViewPreview, , stCriteria<br>
End Sub<br>
<br>
How do I fix this?<br>
<br>
Chris<br>
Melbourne
I'm trying to open a report in VBA and am having trouble with the filtering syntax. I appear to be opening the report ok, but I'm seeing parameter dialog boxes with the filter criteria that I'm trying to specify as the prompt. Code is as follows:<br>
<br>
Private Sub Label20_Click()<br>
Dim stCriteria, BatchNo As String<br>
BatchNo = Me![Batch Number]<br>
stCriteria = "[Batch Number] =" & BatchNo<br>
DoCmd.OpenReport "Certificate of Analysis", acViewPreview, , stCriteria<br>
End Sub<br>
<br>
How do I fix this?<br>
<br>
Chris<br>
Melbourne