Consulting

Results 1 to 3 of 3

Thread: unload array of combobox at run time

  1. #1
    VBAX Contributor
    Joined
    May 2008
    Location
    bangalore
    Posts
    199
    Location

    unload array of combobox at run time

    in vb.6 at run time i am creating array of combo box and loading some values in it. on click event of first combo box i want to unload other comboboxs.

    looking for vb.6 click event code for combobox

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Show us what code you have so far.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Contributor
    Joined
    May 2008
    Location
    bangalore
    Posts
    199
    Location
    [VBA]
    Private Sub combo1_Click()

    For j = form1.Label1().Count - 1 To 1 Step -1
    Unload form1.Label1(form1.Label1().Count - 1)
    Label1(0).Visible = False
    Next j

    For i = 0 To 10
    If i <> 0 Then
    Load Label1(i)
    Label1(i).Left = 120
    Label1(i).Move Label1(i).Left, Label1(i - 1).Top + 400
    Label1(i).Visible = True

    Load Combo1(i)
    Combo1(i).Left = 1920
    Combo1(i).Move Combo1(i).Left, Combo1(i - 1).Top + 400
    Combo1(i).Visible = True
    End If
    Next i
    end sub

    [/VBA]

    If I execute the above code I got the following error
    "Unable to unload within this context"

    I know that is a vb error. It is not possible to unload anything on combo box click event. But I have to load combo boxes and labels at runtime and unload them

    Please help me to achieve it

Posting Permissions

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