Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

advanced microsoft access training london - error trapping

Forum home » Delegate support and help forum » Microsoft Access Training and help » advanced microsoft access training london - Error Trapping

advanced microsoft access training london - Error Trapping

ResolvedVersion Standard

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

Access tip:

Closing form after a certain time period

To make a form close automatically after a certain time period, you need to assign the close function to a macro.

Save the macro and ope up the form in design view. open the Properties sheet.

In the TimerInterval property enter the length of time you want the form open for. This should be in milliseconds, so for instance if you want the form open for 5 seconds enter 5000, for an minute enter 60000.

You now need to attach your macro (to execute the Close action) to the OnTimer event property of the form.



View all Access hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.1 secs.