Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
Resolving a Run-Time Error
◄Contents► ◄Index► ◄Back►
──────────────────────────────────────────────────────────────────────────────
Resolving a Run-Time Error
■ A run-time error is one that occurs while an application is running.
When Visual Basic encounters an untrapped run-time error, it halts the
application, displays an error message, and places the cursor at the
statement where the error occurred. You can use Help to get information
on the possible causes for the error and suggestions for resolving it.
■ To use Help when an error message is displayed:
1. Press F1 while the error message is on the screen
Visual Basic displays a topic with possible causes for the error and
suggestions for resolving the type of error it has detected.
2. Choose OK to clear the message from the screen
3. Correct the error
■ While your application is halted, you can open files or change variable
values in the Immediate window, correct your code, change the next
statement to be executed, and so on. After you've corrected the error, you
can continue running the application from where it stopped by pressing F5
or restart it from the beginning by pressing Shift+F5.
■ A run-time error can also occur when you are running an executable file.
An untrapped error at run time will cause the program to terminate. To
handle a run-time error so that the application can continue running, you
need to set up an error-handling routine.
■ To get Help on syntax for Visual Basic functions, statements, properties,
events, or methods while working in the programming environment:
• Type or select the keyword, the property, event, or method name
• Press the F1 key
See: ◄ERR Function► ◄ON ERROR Statement► ◄Run-Time Error Codes►