PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
[ RESOLVED ] Unloading Forms...-VBForums
Results 1 to 8 of 8

Thread: [ RESOLVED ] Unloading Forms...

  1. #1

    Thread Starter
    ^:^...ANGEL...^:^ wrack's Avatar
    Join Date
    Mar 2002
    Location
    Melbourne, AUSTRALIA
    Posts
    2,689

    Thumbs up [ RESOLVED ] Unloading Forms...

    VB Code:
    1. Dim frm As Form
    2.    
    3.     frmMain.Show
    4.    
    5.     For Each frm In Forms
    6.         If frm.Name <> "frmMain" Then
    7.             Unload frm
    8.         End If
    9.     Next frm

    gives an error...

    Can someone explain why or solve it...???
    Last edited by wrack; Jul 9th, 2002 at 07:42 PM.

  2. #2
    PowerPoster
    Join Date
    Aug 2001
    Location
    new jersey
    Posts
    2,904
    well, it might help if you said WHAT error it gives and where. I assume it's on the unload line.

  3. #3
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    are you trying to unload the form as it loads ?
    -= a peet post =-

  4. #4
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,148
    That code should work. Where does it appear? What error do you get?

  5. #5

    Thread Starter
    ^:^...ANGEL...^:^ wrack's Avatar
    Join Date
    Mar 2002
    Location
    Melbourne, AUSTRALIA
    Posts
    2,689

    Thumbs up hmmmm....

    VB Code:
    1. On Error GoTo ErrorHandlerExit
    2.    
    3.     Dim frm As Form
    4.    
    5.     frmMain.Show
    6.    
    7.     For Each frm In Forms
    8.         If frm.Name <> "frmMain" Then
    9.             Unload frm
    10.         End If
    11.     Next frm
    12.    
    13. ErrorHandlerExit:
    14.     MsgBox "ERROR " & Err.Number & "  " & Err.Description

    gives me the message box "ERROR 0" and no description...

    this might help u understand what I am telling about...

  6. #6
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629


    you have to exit the sub before the lable...

    VB Code:
    1. On Error GoTo ErrorHandlerExit
    2.    
    3.     Dim frm As Form
    4.    
    5.     frmMain.Show
    6.    
    7.     For Each frm In Forms
    8.         If frm.Name <> "frmMain" Then
    9.             Unload frm
    10.         End If
    11.     Next frm
    12.  
    13.     Exit Sub
    14.    
    15. ErrorHandlerExit:
    16.     MsgBox "ERROR " & Err.Number & "  " & Err.Description
    -= a peet post =-

  7. #7

    Thread Starter
    ^:^...ANGEL...^:^ wrack's Avatar
    Join Date
    Mar 2002
    Location
    Melbourne, AUSTRALIA
    Posts
    2,689

    Thumbs up ThankX

    but the error is gone ( strangle...!!! )...

    everyone's help is much appreciated...

  8. #8
    Frenzied Member TomGibbons's Avatar
    Join Date
    Feb 2002
    Location
    San Diego, CA Previous Location: UK
    Posts
    1,345
    There never was an error, thats why it was returning "0", unless you tell it to exit the sub, it will still go through your error handle and return no error

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width