Consulting

Results 1 to 3 of 3

Thread: Problem with coding Sub

  1. #1
    Moderator VBAX Master austenr's Avatar
    Joined
    Sep 2004
    Location
    Maine
    Posts
    2,033
    Location

    Problem with coding Sub

    Im stuck on this sub. This line doesnt look right to me

    [VBA]
    Private
    Sub cboIsland_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboIsland.SelectedIndexChanged cboIsland.SelectedIndexChanged
    [/VBA]

    This is the rest of the code:

    [VBA]
    ' This event handler allows the user to enter the island choice
    ' and the calls subprocedures to place the island activities in the list.
    Dim intIslandChoice AsInteger
    intIslandChoice = Me.cboIslandChoice.selectedindex
    [/VBA]

    On the last line of the second block of code, when I typed a . after me.cboIslandChoice, SelectedIndex should have beena choice I would have thought. However I think it has to do with the double

    [VBA]cboIsland.SelectedIndexChanged[/VBA]

    in the first block of code. Anyone have any suggestions?
    Peace of mind is found in some of the strangest places.

  2. #2
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,724
    Location
    Are you sure this is VBA? It sort of looks like VB or something else?

    Assuming that cboIsland is a combobox, there is not a standard event handler to catch an Index change, at least based on looking in the Excel VBE.

    Paul

  3. #3
    Moderator VBAX Master austenr's Avatar
    Joined
    Sep 2004
    Location
    Maine
    Posts
    2,033
    Location
    Sorry it's straight vb. Thought someone might see something
    Peace of mind is found in some of the strangest places.

Posting Permissions

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