G
Guest
I want to print a report on click of a button, for which I have the following
code OnClick of a button ...
DoCmd.OpenReport stDocName, acViewPreview, "APPENDIX A-2",
"[CONTRACT_NO]=" & "'" & Me![CONTRACT_NO] & "'" & " and [TO_NO]= " & "'" &
StrTO_NO & "'"
If I remove the following
& " and [TO_NO]= " & "'" & StrTO_NO & "'"
it works fine, but after adding the above text, I get data type mismatch.
actually [TO_NO] is numeric fields linked to a sql server table.
I am converting it to String using - Dim StrTSO_NO As String
I get "Data Type Mismatch in Criteria Expression"
I tried both without the converted variable and with the converted variable,
both times I get the same error.
I am frustrated, can someone please help me?
Thank you,
-Me
code OnClick of a button ...
DoCmd.OpenReport stDocName, acViewPreview, "APPENDIX A-2",
"[CONTRACT_NO]=" & "'" & Me![CONTRACT_NO] & "'" & " and [TO_NO]= " & "'" &
StrTO_NO & "'"
If I remove the following
& " and [TO_NO]= " & "'" & StrTO_NO & "'"
it works fine, but after adding the above text, I get data type mismatch.
actually [TO_NO] is numeric fields linked to a sql server table.
I am converting it to String using - Dim StrTSO_NO As String
I get "Data Type Mismatch in Criteria Expression"
I tried both without the converted variable and with the converted variable,
both times I get the same error.
I am frustrated, can someone please help me?
Thank you,
-Me