BUG: Err.Raise 40040 Stores the Err.Number as 440

ID: Q216547


The information in this article applies to:
  • Microsoft Visual Basic Learning, Professional, and Enterprise Editions for Windows, versions 5.0, 6.0


SYMPTOMS

When the statement Err.Raise 40040 is executed, the value of Err.Number is set to 440.


RESOLUTION

Do not use the user defined error 40040.


STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.


MORE INFORMATION

If you raise the error code 40040 (=&H9C68) using the Err.Raise method, Visual Basic sets the value of Err.Number to 440. The Err.Description and other properties of the Err object are set correctly.

Steps to Reproduce Behavior

  1. Create a Visual Basic Standard EXE project. Form1 is created by default.


  2. Paste the following code in the General Declarations section of Form1:
    
    Private Sub Form_Load()
       On Error Resume Next
       Err.Raise 40040
       MsgBox Err.Number & ": " & Err.Description ' will display 440
       Err.Clear ' Clear the error for the next Raise method
       Err.Raise 440
       MsgBox Err.Number & ": " & Err.Description
    End Sub 


  3. Run the program. A message box with the error number and description raised for 40040 will be displayed.


  4. Click OK and a message box with the error number and description raised for 440 will be displayed.


Additional query words:

Keywords : kbVBp500bug kbVBp600bug kbGrpVB
Version : WINDOWS:5.0,6.0
Platform : WINDOWS
Issue type : kbbug


Last Reviewed: February 27, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.