Runtime Error

G

Gunner113

I'm testing an installation of the runtime on a system without Access. I run
my mdb and it opens as expected. The controls respond as they should
(including some that use modules) until I click a button and I get the
following general message:

"Execution of this application has stopped due to a run-time error."

"The application can't continue and will be shut down."

As a complete file on my development system, as well as others with Access
installed, it works fine. With the lack of tools available on the runtime
version, all I can ask is where do I start?
 
J

Jeanette Cunningham

Hi Brian,
as you just found, this happens in the runtime version if there are any
unhandled errors.

Put error handling on all code routines.
Even just one sub or function without error handling will crash the app if
an error happens while that piece of code is running.
You need solid error handling like this example.
Even better is an error logger that logs the errors to an errors table and
doesn't show the real error number and description to the users.

Private Sub YourSubName
On Error GoTo Err_Handler

Call SetAssmtType(Me.txtAssmtResultID)

Exit_Handler:
Exit Sub

Err_Handler:
MsgBox Err.Number & " " & Err.Description
Resume Exit_Handler
End Sub


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top