Runtime error when i open a form

rick roberts

Registered User.
Local time
Today, 16:45
Joined
Jan 22, 2003
Messages
160
i have a main form with a button that opens a simple form of 2 columns. this all works fine as an .mdb file but when i create an installer package to use with access runtime i have a problem - when i open the second form it shows on the screen but has a runtime error and when the error box is clicked the program shuts down
im using office 2010
thanks in anticipation
 
You must have error handlers in all your functions/subs for your packaged solution to work nicely. And remember to Debug > Compile and Compact & Repair afterwards too.
 
i did wonder afterwards if that was my problem - i found it happens on two other buttons that print reports
i guess its a little scraPPY of me not to be using error catches
thanks for the reply ill get on it right away
 
well i tried Resume Next thinking that this would override the error but it doesnt seem to work
 
Resume Next doesn't clear the error. Proper error handling should be enforced.
 
that seems a bit difficult when i dont know the actual cause of the error
 
Well, you can't really predicate all scenarios so to be safe (and to ensure that your clients don't get annoyed when it unexpectedly crashes), error handle all functions/subs. Yea, I know it's a tough job.

Just make it a habit to put error handlers everytime you create a function/sub.
 
im not that usedc to error handling and find it ard to predict what the error might be - if the routines work ok without errors how do i predict what might go wrong?
 
There's only so much you can predict with lots and lots of testing. The links I provided provide more than enough information on error handling.
 
I hope you hard at work adding those error handling code lines ;)
 
You don't know what error handlers are or you don't know which functions/subs to apply them on?
 
i understand what error handlers should do but not too familliar - i would suppose that before you can overcome an error you first have to ascertain what the error might be?
 
And how do you accomplish that then? By inserting an error handler that shows you what the error number and text is, as per the links provided to you earlier. After you know what the known errors are, then you can handle those, and sweep all else under a CASE ELSE, with some appropriate text shown to the user.

Code:
MsgBox "An unknown error - please grab your children and coworkers and run before the application explodes. You have 10 seconds", vbCritical

alternatively:

Code:
MsgBox Err.Number & Err.Description
 
Last edited:
i already tried this -
PROC_ERR:
MsgBox "Error: (" & Err.Number & ") " & Err.Description, vbCritical
but even in the runtime version it gives -
Error(0)
which i presume no error?
 
Paste the entire subroutine, that contains the error handler.
 

Users who are viewing this thread

Back
Top Bottom