Results 1 to 2 of 2

Thread: How to erase an array of Menus

  1. #1

    Thread Starter
    Fanatic Member paralinx's Avatar
    Join Date
    Jun 2005
    Location
    Michigan
    Posts
    987

    How to erase an array of Menus

    Hey all,

    How can I go about errasing an array of Menus name mnuArtist? This is what I tried

    VB Code:
    1. Erase frmMain.mnuArtist

    But it gives me the error of "expected array"

    How can I do this?

  2. #2
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: How to erase an array of Menus

    If it is control array then you have to use Unload statement:
    VB Code:
    1. Dim i%
    2.  
    3. On Error Resume Next
    4.  
    5. Form i = mnuArtist.LBound + 1 To mnuArtist.Ubound
    6.     Unload mnuArtist(i)
    7. Next i
    NOTE: you CANNOT unload any member of control array that were added in design - only those that you added using Load statement at runtime.
    It was presumed that only ONE instance was created in design and rest of them at runtime so that's why you will see mnuArtist.LBound + 1 in the loop.

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