How to pass parameters to Access reports from VB.NET

D

Dean Slindee

I would like to pass multiple parameters from a VB.NET application to an
existing Access 2003 application's reports (essentially using Access as a
report writer where the reports already exist).
The reports' datasource is a stored procedure with multiple @parameters.

This code works where the report requires no parameter:
Dim strAccessDBPath As String
Dim booReturn As Boolean = False
strReportName = "rptCMOTeam1"
strAccessDBPath = "W:\Clinical Services Database\Clinical
Services.ade"
booReturn = OLEPreviewReport(strDB, strReportName)

A Microsoft example shows using a single parameter:
booReturn = OLEPreviewReport(strDB, strReportName),
strWhere:="OrderId = 10251")

Would "OrderId" feed into a @OrderID parameter in a stored procedure, or is
there another way to replace the strWhere clause to feed the @parameters in
the stored procedure?

Thanks,
Dean Slindee
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top