Solved

MDE Outputto error

Posted on 2008-10-08
8
789 Views
Last Modified: 2012-08-13
Hi Experts,

I have created an MDE from a FE/BE split database.

On a form, I have an option to save a report (in smp format), email it, and preview/print it.  If the user initiates the save process (which opens up a standard save dialog box and then escapes out (or x's out), the attached error message is displayed.

Is there a way to avoid this error message (which I think would be confusing and counterintuitive to the user?

Thx,

Deedub84
Error.bmp
0
Comment
Question by:deedub84
  • 4
  • 4
8 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 22668509
you have to get the .mdb version of the FE and fix it there.
add codes to the save process to trap any cancellation which will cause the filename to be equal to ""

then create another .mde and replace the old ones
0
 
LVL 1

Author Comment

by:deedub84
ID: 22668803
Thks Cap,  I have the mdb, so that's not a problem, I guess my question really is what is that error trapping, I'm not clear.

My code is bare, bare bones; see below.

Any suggestions would be great!
Private Sub btnPrintReport_Click()
 
DoCmd.OutputTo acOutputReport, "rptSummary", acFormatSNP
 
End Sub

Open in new window

0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 22668844
( If the user initiates the save process ) where is this done?
0
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
LVL 1

Author Comment

by:deedub84
ID: 22669192
On a button on a form; the code for which is attached above.

In the mdb, when I cancel out of the save, I get an error 2501 "Output to action canceled".

I added "On error resume next" in the PrintReport_Click procedure; in the MDB it avoided the error message.

In the MDE though, it produced a fatal error!!  
Fatal-error.bmp
0
 
LVL 1

Author Comment

by:deedub84
ID: 22669290
I'm relatively new to MDE files.... I'd welcome comments about what problems / issues / design approaches are required.

0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 22669307


create an error trapping routine



Private Sub btnPrintReport_Click()
on error goto savecancelerr
DoCmd.OutputTo acOutputReport, "rptSummary", acFormatSNP
 
savecancelerr:
   if err.number=2501 then
      err.clear
      resume next
   end if
 
End Sub

Open in new window

0
 
LVL 1

Author Comment

by:deedub84
ID: 22669747
Hmm... the MDE is still bombing out with a fatal error.  Although not with the MDB
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 22669782
before you create an mde make sure that the mdb compiles without error

DEBUG>Compile
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
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…
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…

803 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