Access Runtime - Runtime error (1 Viewer)

mazza

Registered User.
Local time
Yesterday, 23:39
Joined
Feb 9, 2005
Messages
101
I have distributed an Access Application using Access Runtime (2002).

The problem is when an error occurs or a required entry is not entered the system automatically created a runtime error message in a VBOKonly message format and will close the application as soon as you click on OK.

Now I know to avoid it is to irradicate all posible errors hwr that is not always feasible.

Is there a way to stop Access runtime closing an application on an error?
 

izyrider

Registered User.
Local time
Today, 07:39
Joined
Apr 17, 2005
Messages
67
no!

if you are playing with runtime you have no choices: trap (and elegantly handle) all possible errors everywhere.

runtime does not care if it is feasible or not, it just sits there waiting to quit when you overlook a possible error.

izy
 

ghudson

Registered User.
Local time
Today, 02:39
Joined
Jun 8, 2002
Messages
6,195
You can not trap for all possible errors but you must have an error handler in all of your subs and functions to prevent the db opened in runtime from shutting down.

Something as simple as this is all you need in all your routines...

Code:
Private Sub Form_Open(Cancel As Integer)
On Error GoTo Err_Form_Open
    
    'your code here
    
Exit_Form_Open:
    Exit Sub

Err_Form_Open:
    MsgBox Err.Number & " - " & Err.Description
    Resume Exit_Form_Open
    
End Sub
 

modest

Registered User.
Local time
Today, 02:39
Joined
Jan 4, 2005
Messages
1,220
Press Ctrl-Break to go to the Code to view the error before the application closes.
 

Users who are viewing this thread

Top Bottom