basepointdesignz
Programmer
Hi guys and gals,
Is there any other way or event for triggering the adding of items to a combobox in VBA? I'm writing a program for my work and I have two comboboxes that are filled with the current drawing's block names. The block names are added using the FormLoad (or in VBA) the UserForm_Activate event. This works fine but for one problem.....
I have a GetPoint command set up to obtain the origin point for the insertion point (for the blocks). This obviously causes the form to be hidden to first obtain the coordinates. whenever the form is hidden and then shown again the Userform_Activate event is triggered and another set of block names is added to the list, so now the list is twice as long with duplicate block names. This again happens if the form is hidden and shown again - adding another set of the names to the list....and so on.
I've tried RemoveItem using the userform_Deactivate event to remove all the items so that the Activate event will add them again - well, that didn't work.
Does anyone know what could be causing this problem or even how to remedy it. In VB there is a List property for the Combbox, so you can add the items at Design Time, but in VBA this property is not available - Aaaaarghhh!!
Thanks in advance..
Renegade..
Is there any other way or event for triggering the adding of items to a combobox in VBA? I'm writing a program for my work and I have two comboboxes that are filled with the current drawing's block names. The block names are added using the FormLoad (or in VBA) the UserForm_Activate event. This works fine but for one problem.....
I have a GetPoint command set up to obtain the origin point for the insertion point (for the blocks). This obviously causes the form to be hidden to first obtain the coordinates. whenever the form is hidden and then shown again the Userform_Activate event is triggered and another set of block names is added to the list, so now the list is twice as long with duplicate block names. This again happens if the form is hidden and shown again - adding another set of the names to the list....and so on.
I've tried RemoveItem using the userform_Deactivate event to remove all the items so that the Activate event will add them again - well, that didn't work.
Does anyone know what could be causing this problem or even how to remedy it. In VB there is a List property for the Combbox, so you can add the items at Design Time, but in VBA this property is not available - Aaaaarghhh!!
Thanks in advance..
Renegade..