R
Ray
I have created a form which allows the user to open a
report using various values merged into the
stLinkCriteria. This works great due to some help from
this newsgroup. I have also added the final line in the
code so that the criteria used can be displayed in a
textbox on the report that is being opened. I seem to
have an error in the syntax. Below is the last few lines
of the code used to open the report using the filter
criteria. The last line is the one that is creating
problems for me. Can you see what I have done wrong? I
have tried variations using "[ ]" and such but to no
avail.
If Not IsNull(Me![PONumber1]) Then
If Not IsNull(vStr) Then vStr = vStr & " And "
vStr = vStr & "[PoNum]=" & Me![PONumber1]
End If
If Not IsNull(Me![RoutingNum]) Then
If Not IsNull(vStr) Then vStr = vStr & " And "
vStr = vStr & "[RoutingID]=" & Me![RoutingNum]
End If
stLinkCriteria = vStr
DoCmd.OpenReport stDocName, acPreview, , stLinkCriteria
Reports.DetailReport.text99=Forms.CriteriaForm.RoutingNum
report using various values merged into the
stLinkCriteria. This works great due to some help from
this newsgroup. I have also added the final line in the
code so that the criteria used can be displayed in a
textbox on the report that is being opened. I seem to
have an error in the syntax. Below is the last few lines
of the code used to open the report using the filter
criteria. The last line is the one that is creating
problems for me. Can you see what I have done wrong? I
have tried variations using "[ ]" and such but to no
avail.
If Not IsNull(Me![PONumber1]) Then
If Not IsNull(vStr) Then vStr = vStr & " And "
vStr = vStr & "[PoNum]=" & Me![PONumber1]
End If
If Not IsNull(Me![RoutingNum]) Then
If Not IsNull(vStr) Then vStr = vStr & " And "
vStr = vStr & "[RoutingID]=" & Me![RoutingNum]
End If
stLinkCriteria = vStr
DoCmd.OpenReport stDocName, acPreview, , stLinkCriteria
Reports.DetailReport.text99=Forms.CriteriaForm.RoutingNum