Solved

DoCmd.RunCommand acCmdSaveAs Works in MDB but not in MDE

Posted on 2012-03-27
6
1,064 Views
Last Modified: 2012-03-27
Would like to export a report into a textfile, doesn't work in MDEs
0
Comment
Question by:themrocc
[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
  • 3
  • 2
6 Comments
 
LVL 77

Expert Comment

by:peter57r
ID: 37770644
Are you saying this happens on the same pc - works for an mdb but doesn't work for an mde on the same machine?
0
 
LVL 77

Expert Comment

by:peter57r
ID: 37770679
I would add that I always thought that accmdsaveas just allowed you to save an object within your database (which would explain why it doesn't work in an mde).  I didn't know you could use it to export a report.  

Just trying it here with a report I don't get any option to save as a text file.

SO I'd be interested in seeing the surrounding code that produces the text file from your mdb.
0
 

Author Comment

by:themrocc
ID: 37770828
It works perfectly in an MDB; the code ist just as stated above:
DoCmd.RunCommand AccCmdSaveAs
The MDB produces a dialog box where you can choose the filetype , destination path and filename.
The MDE comes up with an error: Can't open <procedurname>
BTW: the built-in symbol "Save as/Export..." will be grayed in the MDE, so I tried to make the code myself...
0
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
LVL 77

Expert Comment

by:peter57r
ID: 37770872
Which version of Access are you using?

I can't get such a dialog box in either A2003 nor in A2010.
The dialog I get in A2003 only offers the option of saving a report as a report or a Data Access Page and in A2010 the DAP option has gone so all I get is an option to save as another report.
Capture3.JPG
0
 

Author Comment

by:themrocc
ID: 37770963
It's A97
Snap3.JPG
0
 
LVL 57

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 500 total points
ID: 37771006
Use the output to method rather then saveas.

Jim.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying 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

Suggested Solutions

Title # Comments Views Activity
linked sql server tables - should I or shouldn't I and why 4 63
Calculation in a Report 13 43
Return Data From Website in Access 6 59
Export individual report to pdf 2 41
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

752 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