I'm trying to use the DoCmd.OpenReport function with two stLinkCriteria & a wildcard feature on one of the slc. When I enter data in these feilds on the form, a DataTypeMismatch error is returned.
Can anyone see if there is an error in the code?
The table which the query for the report is built is an ODBC link to an Oracle DB, and the feild matching the slc with the wildcard is of a long datatype. Maybe the problem is with the long datatype?
Hopefully some can help.
Thanks
----------------
Code
-----------------
Dim stLinkCriteria1 As String
Dim stLinkCriteria2 As String
stDocName = "RTP_shipping_papers_view"
stLinkCriteria1 = "[POL_PART_NO]=" & "'" & Me![spn] & "'"
stLinkCriteria2 = "[COMNT] like " & "'" & "*" & Me![sseq] & "'"
DoCmd.OpenReport "RTP_shipping_papers_view", acViewPreview, , stLinkCriteria1 And stLinkCriteria2
Can anyone see if there is an error in the code?
The table which the query for the report is built is an ODBC link to an Oracle DB, and the feild matching the slc with the wildcard is of a long datatype. Maybe the problem is with the long datatype?
Hopefully some can help.
Thanks
----------------
Code
-----------------
Dim stLinkCriteria1 As String
Dim stLinkCriteria2 As String
stDocName = "RTP_shipping_papers_view"
stLinkCriteria1 = "[POL_PART_NO]=" & "'" & Me![spn] & "'"
stLinkCriteria2 = "[COMNT] like " & "'" & "*" & Me![sseq] & "'"
DoCmd.OpenReport "RTP_shipping_papers_view", acViewPreview, , stLinkCriteria1 And stLinkCriteria2