Re: Populating ComboBox




<rn5a@xxxxxxxxxxxxxx> wrote in message
news:1170340113.285671.59920@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Now why is the

Combo1.ListIndex = 0

line invoking the OnClick event function of the ComboBox?

Because it is essentially the same as if a user selected the first item.
Easy to fix, set a flag. One way to do this (out of millions):

In the form declarations

Private bnBusy as Boolean

Then in the routine:
bnBusy = True
Combo1.ListIndex = 0
bnBusy = False

Then at the start of the Click event
If not bnBusy then
' Your existing code.
End If

Best Regards
Dave O.


.



Relevant Pages

  • Re: Populating ComboBox
    ... bnBusy = False ... the ComboBox so that I can see the records of a particular UserName, ... 'entire code of the OnClick event function of the ComboBox ... MsgBox does say 'False' correctly but it appears more than 60 times ...
    (microsoft.public.vb.general.discussion)
  • Re: Populating ComboBox
    ... Private bnBusy as Boolean ... what do you mean by "routine"? ... Do you mean the Form_Load sub? ... line in the ComboBox's OnClick event function. ...
    (microsoft.public.vb.general.discussion)
  • Re: Populating ComboBox
    ... bnBusy = False ... Dave, what do you mean by "routine"? ... Do you mean the Form_Load sub? ... line in the ComboBox's OnClick event function. ...
    (microsoft.public.vb.general.discussion)