Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error routine
Message
General information
Forum:
Visual Basic
Category:
Access
Title:
Miscellaneous
Thread ID:
00679201
Message ID:
00679356
Views:
22
Hi,

Just, add error handler to load proc of the child form.

Igor


>However, is there a way to create a generic routine that all forms within Access could use as an errorhandler? VisFox can simply call a routine for any error. At this point, I would have to introduce on error statements and duplicate logic for dozens of forms (unless I'm missing something from the documentation).
>
>the documentation states that the program will look through calling programs for error-handling routines. I have a form that is a menu with buttons calling other forms. In the click event of a button, I added the on error statement and routine. However, when an error occurs within the load proc of the child form, I get the generic routine. Any suggestions?
>
>Thanks
>
>
>>In VB, sample error trapping routine looks like this:
>>
>>
>>Sub SampleSub()
>>
>>On Error GoTo ErrorHandler
>>
>>  [normal code for SampleSub]
>>
>>SampleSubExit:
>>  Exit Sub  'If no error is generated, error code bellow must not be executed
>>
>>ErrorHandler:
>>  [Error-handling code]
>>  Select Case Err.Number
>>    Case [Some error number]
>>      [handling code]
>>    Case [Some error number]
>>      [handling code]
>>........................
>>    Case [Some error number]
>>      [handling code]
>>    Case Else
>>      [handling code]
>>  End Select
>>  Resume SampleSubExit  'Go to exit from sub
>>End Sub
>>
>>
>>If no error is generated, sub will end at Exit Sub statement. If an error occurs, you must detect what is this error (through Select Case statement) and do appropriate actions. Then most often sub ends.
>>For every Case you can resume executing from different place (you must put label on place where code will resume).
>>There are also On Error Resume Next statement instead of GoTo [label] (to skip failed row) or On Error Resume Statement (to retry). Read MSDN for these statements.
Igor Gelin
Database Developer
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform