Results 1 to 2 of 2

Thread: object variable problem (dumb question)

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Posts
    15

    Talking

    now this may be a stupid question, but how do you make the errobj.description, and errobj.source recieving a error message, then pipe it to another subroutine. You just pipe it through the declarations for subroutines and functions right?? private function WackyFunc(errobj) ???
    how do I get it to recieve the value?

    sorry for the dumb question,
    Thanks
    [email protected]

  2. #2
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    Code:
    'here is an example but I give it an error number
    'just for demo purposes.
    'if this were in your errorhandler then
    'it would do it's own stuff and you wouldn't be
    'hardcoding the number in
    
    'get error source and description
    
    Private Sub Command1_Click()
    
    Dim Msg$
    
    ' If an error occurs, construct an error message
    'hardcode the error number for test purpose
    
        Err.Number = 20520
    
    If Err.Number <> 0 Then
    'uses msgbox for display you can code it to go where you want and do what you want
       Msg$ = "Error # " & Err.Number & " was generated by " _
             & Err.Source & Chr(13) & Err.Description
       MsgBox Msg$
    End If
    
    End Sub
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width