Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Access Report from a Command Line

Posted on 2003-11-30
6
Medium Priority
?
783 Views
Last Modified: 2010-05-18
I want to be able to run a report in an access 97 mdb from a command line.
Any suggestions?
0
Comment
Question by:imnotahomey
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 10

Expert Comment

by:jobrienct
ID: 9848363
not sure, you want to run a report from the command line, does this mean you simply want it to quietly print out your report without bringing up the access interface? or do you mean you want to start access and have it automatically run your report and then exit?

regards,

John
0
 
LVL 8

Expert Comment

by:Benjamin_Luk
ID: 9848439
First create one macro to open your report, then use following command line to open your mdb file , it will run the macroName to open your report:

"C:\Program Files\Microsoft Office\Office\MSAccess.exe" "C:\Program Files\Microsoft Office\Office\Samples\Northwind.mdb" /x MacroName

Best Regards

Ben
0
 

Author Comment

by:imnotahomey
ID: 9848757
Thanks ben!

But what if I need to send some parameters to use for the report in the command line?
0
Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

 
LVL 8

Expert Comment

by:Benjamin_Luk
ID: 9848795
Can not add report parameters in the command line, and you do not need to set it in the command line. If you have set the parameters in your report to let user input, access will pop up the dailog box for user to input the value when you run this command line.

Regards

Ben
0
 
LVL 28

Accepted Solution

by:
TextReport earned 1200 total points
ID: 9849033
If you run a database with a Macro /x MyMacro you can run a function from that macro. In the Function you can use Command$ to return the value from the /CMD parameter from the Command Line

"C:\Program Files\Microsoft Office\Office\MSAccess.exe" "C:\Program Files\Microsoft Office\Office\Samples\Northwind.mdb" /x MacroName /CMD "[MyField]=5"

Function PrintReport
     docmd.openreport "MyReport", , Command$
End Function

and the macro does a runcode PrintReport()

Cheers, Andrew
0
 

Author Comment

by:imnotahomey
ID: 9855157
That's brilliant!
Thanks Andrew!

The reason why I wanting this bizzar task is because users would like an identical report that is in access to be written in oracle reports. They then wanted to call this oracle report from a java application.
Rather than create a new report in oracle (which has not been much success) I wanted to call the report straight from access. I had not found any bridges for java to access so I thought the command line would be the best thing.
Thanks again Andrew!

Boog.

0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question