Dave has attended:
Access VBA course
Error Trapping
I have created an Access database employing only tables, queries and forms (no modules), and wish to deploy it to a user who is using only the MS Access Runtime. Experience has shown that I need to incorporate error trapping.
Does this mean that each form needs to be opened from within a module, rather than directly from the Switchboard, as I have it at the moment?
RE: Error Trapping
Hi Dave
Yes you definately need to include error trapping as otherwise the user will just get a really horrible error message given too them by access and then the application will close.
As far as opening everything from within a modules goes, I think that you should be fine just opening everything from switchboards.
Hope thins helps
David
RE: Error Trapping
My question was more to do with how to include error trapping.
I can see that I could do it by opening the form from within a module that included an error block, but your answer implies that I can implement error trapping without doing that.
RE: Error Trapping
Hi Dave
What I meant by this was that you should be able to code all of the error trapping directly into the VBA. You should place a statement within your could so that anywhere that an error could occur, there is a statement to catch the error, and then call an error handler. An example is shown below
Sub MystuffHere()
On Error GoTo ErrorHandler
My statements here
Exit Sub
ErrorHandler:
My error handling statements go here
End Sub
I hope this helps, if not get back to me
David