473,762 Members | 6,675 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to pass parameters to Access report via Automation

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 = "rptCMOTeam 1"
strAccessDBPath = "W:\Clinica l Services Database\Clinic al
Services.ade"
booReturn = OLEPreviewRepor t(strDB, strReportName)

A Microsoft example shows using a single parameter:
booReturn = OLEPreviewRepor t(strDB, strReportName),
strWhere:="Orde rId = 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
Nov 21 '05 #1
2 3179
This may be possible, I don't know. You could write data to a table in
Access and have the report use the table are criteria for the report...but,
frankly I think this is a bad idea.

Let Access be Access and VB.Net be VB.Net. The is just my opnion however.

"Dean Slindee" <sl*****@charte r.net> wrote in message
news:po******** ***********@fe0 4.lga...
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 = "rptCMOTeam 1"
strAccessDBPath = "W:\Clinica l Services Database\Clinic al
Services.ade"
booReturn = OLEPreviewRepor t(strDB, strReportName)

A Microsoft example shows using a single parameter:
booReturn = OLEPreviewRepor t(strDB, strReportName),
strWhere:="Orde rId = 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

Nov 21 '05 #2
I believe the strWhere part below is the same as the box within Access
where you put the parameter.

A Microsoft example shows using a single parameter:
booReturn = OLEPreviewRepor t(strDB, strReportName),
strWhere:="Orde rId = 10251")

Saying that, I believe something like this would work:
strWhere:="@ord erID = value, @param2 = value, @param3 = value, @param4 =
value"

Try what I did above out. If it does not work with the @ signs, remove
and try again. Let us know.

Thanks,

Rocco

*** Sent via Developersdex http://www.developersdex.com ***
Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
23876
by: Nicola | last post by:
Hi Everyone, I am new to programming and would like to know how to open an access Report from within vb 6. I am trying to write a program to organise cross stitch threads. I have found out how to use a database table but all I want to do now is to click a command button to display this access report. Any suggestions please ?????
2
15429
by: Tom Weddell | last post by:
Can I call an Access report from VB.Net? (I'm using access as the backend.) Thanks in advance.
8
3537
by: Mike MacSween | last post by:
tblCourses one to many to tblEvents. A course may have an intro workshop (a type of event), a mid course workshop, a final exam. Or any combination. Or something different in the future. At the moment the printed output is usually going to Word. It's turning into an unholy mess, because I'm having to prepare umpteen different Word templates, and the queries that drive them, depending on what events a course has.
16
48886
by: cyranoVR | last post by:
This is the approach I used to automate printing of Microsoft Access reports to PDF format i.e. unattended and without annoying "Save As..." dialogs, and - more importantly - without having to use a commercial program such as Adobe Acrobat and its associated API. The technique uses Ghostscript and Redirection Port Monitor - two free programs for creating PDF documents provided free by Russell Lang. The actual automation requires VBA...
0
1250
by: Ken | last post by:
I got a VB6 application and Access 2000 report. How could I pass two parameters from VB6 form to the Access and open up the Report in Access?
6
3574
by: Woody Splawn | last post by:
I am using SQL Server 2000 as a back-end to a VS.net Client/Server app. In a certain report I use a view as part of the query spec. For the view, at present, I am querying for all the records in the table. But I am wondering if there is a way, at runtime, to pass values to the View (like start date and end date) so that I don't have to return every record in the table of my view. If I can't pass a parameter, perhaps I can create a view,...
2
14129
by: Dean Slindee | last post by:
Anybody written code in VB.NET to: 1) show a print preview window of reports already written and stored in an Access 2002 database; or 2) execute the print of a report stored in an Access 2002 database? Thanks, Dean Slindee
0
1369
by: Dean Slindee | last post by:
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 =...
4
3949
by: syversda | last post by:
I have a report that runs a bunch of code to populate variables and then those variables are used as the control source in my report fields. for example var1 gets # of records in a table I have a field on my report called myfield1 and the control soure is = This has always worked in other versions of MS Access but now it throws #Name or #Error in some cases on the report. I've stepped through the code and the variables are getting...
0
9554
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9377
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10136
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9989
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8814
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6640
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5266
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3913
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3509
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.