Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DoCmd.OpenReport with two stLinkCriteria & wildcard

Status
Not open for further replies.

dkape

MIS
Mar 22, 2001
17
0
0
US
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
 
Try this instead
Open your report in design view
Then Create a query using the Query builder in the Record Source Property. Then in the QBE grisd set up your criteria etc.
Let the power of the query do the work for you.

Open the report wihoptu any parameters becasue the query behind the report is do it instead.
DougP, MCP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top