PDA

View Full Version : Problem with coding Sub



austenr
04-27-2010, 07:19 AM
Im stuck on this sub. This line doesnt look right to me


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


This is the rest of the code:


' 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 As Integer
intIslandChoice = Me.cboIslandChoice.selectedindex


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

cboIsland.SelectedIndexChanged

in the first block of code. Anyone have any suggestions?

Paul_Hossler
04-27-2010, 08:39 AM
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

austenr
04-27-2010, 09:22 AM
Sorry it's straight vb. Thought someone might see something