Solved

Access Report from a Command Line

Posted on 2003-11-30
6
769 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
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 
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 300 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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

Suggested Solutions

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

737 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