Re: how do i add items in the drop down box using Visual basic? by LEC
LEC
Wed Nov 16 18:07:09 CST 2005
Hi Mita,
You can double click on the combobox. That will get you to the view
code window and the change event for the combobox. You want to put
this code in the User Form Initialize event. So when you double click
on the combobox you will see something like:
Private Sub Comboxbox1_Change()
End Sub
You don't want to put the code here. You need to change to the user
form initialize event. To do this you would select the left dropdown
box (this is where all the objects on your form are). Select User Form
(its at the very bottom). Once you select the user form your object
drop down should say User Form. In the right drop down box, select
"Initialize" (if it is not already selected) . Now in the code window
you should see.
Private Sub UserForm_Initialize()
' Put the code for the combobox here.
End Sub
I have indicated above where the code should go.
HTH
LEC