G
Guest
I am using Office XP Pro 2002 and I need some help on a report.
I want to print the report based on one Test# or 2 Test#'s. I can get it to
print the one Test# but when I enter the second Test# it prints all Test#'s.
This is the code I have written:
Dim strSQL As String
Dim strWhere As String
'Build the wherecondition to use in the OpenReport method.
If Not IsNull(FirstTest) Then
If IsNull(SecondTest) Then
strWhere = strWhere & " TestNo = " & "'" & FirstTest & "'"
ElseIf Not IsNull(SecondTest) Then
strWhere = strWhere & " TestNo = " & "'" & FirstTest & "'" & "
OR " & "'" & SecondTest & "'"
End If
End If
I would appreciate any help I can get on this question.
Thanks,
Curt
I want to print the report based on one Test# or 2 Test#'s. I can get it to
print the one Test# but when I enter the second Test# it prints all Test#'s.
This is the code I have written:
Dim strSQL As String
Dim strWhere As String
'Build the wherecondition to use in the OpenReport method.
If Not IsNull(FirstTest) Then
If IsNull(SecondTest) Then
strWhere = strWhere & " TestNo = " & "'" & FirstTest & "'"
ElseIf Not IsNull(SecondTest) Then
strWhere = strWhere & " TestNo = " & "'" & FirstTest & "'" & "
OR " & "'" & SecondTest & "'"
End If
End If
I would appreciate any help I can get on this question.
Thanks,
Curt