RE: How do I debug in the VBA window?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



You need to develop an good descriptive error handler for your sub and
functions some brief guidelines can be found at

http://www.cardaconsultants.com/en/msaccess_vba.html under the Error
Handling section.

In you error handler include the source. IE include the sub name such as
frm Switchboard / Form Current. This in an instant will allow you to
identify exactly where the error is comming from.

I personally use the following and it seems to work well


MsgBox "MS Access has generated the following error" & vbCrLf & vbCrLf &
"Error Number: " & _
Err.Number & vbCrLf & "Error Source: Form_Frm Startup / Form_Open" &
vbCrLf & _
"Error Description: " & Err.Description, vbCritical, "An Error has
Occured!"

Hope this helps,

Daniel




"scubadiver" wrote:

Get the following message:

Syntax error (missing operator) in query expression ' '.

As far as I am aware, it is coming from one particular form but I don't know
exactly where the error is coming from and I am not entirely sure how to
debug.

Can someone advise?

cheers!

--

Watch "9/11 Press for Truth".
.



Relevant Pages

  • Re: Error handling in VB6
    ... Private Sub DoThis() ... OnError GoTo SomeErrHandler ... VB6 has no such thing as "truly" structured error handling. ... VB6 has no such thing as a global error handler. ...
    (microsoft.public.vb.general.discussion)
  • Re: good gotos and bad gotos
    ... Dim ItsCool as Boolean ... Private Sub CommandButton1_Click ... general I see a lot of overuse of the error handler. ... "When handling user input errors you should be able to avoid GoTo ...
    (microsoft.public.excel.programming)
  • Re: inserting text at mouse position
    ... >way to report this to MSoft to get their take on this behavior. ... Create a new form bound to a table that has a memo field. ... >>>End Sub ... So the work around is to add an error handler that will ...
    (microsoft.public.access.formscoding)
  • RE: Error 2455 on close of db
    ... Private Sub Form_Close ... On Error Goto Err_Proc ... This is a simple-as-possible error handler ... This is your exit point for the sub... ...
    (microsoft.public.access.formscoding)
  • RE: Setting importance via VBA using rules wizard
    ... Private Sub Application_Startup ... Private Sub olInboxItems_ItemAdd ... My error handler seems not to execute (it certainly doesn't ... >>> script error from the rules wizard. ...
    (microsoft.public.outlook.program_vba)