Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic Object Removal

Status
Not open for further replies.

mushin

Programmer
Oct 4, 2000
49
I am successfully creating and using dynamically created combo boxes, but can not seem to "remove" them. I can hide them but if the user clicks in a certain field the code tries to instantiate tehem again and leads to a runtime error.

my creation code is :
dim WihEvents optbox as ComboBox

Set optbox = Controls.Add("VB.ComboBox, _
"mycomboBox, Picture1)

My remove code is:
Controls.Remove "myComboBox"

I receive a "Cannot Unload Object in this context" error.
Anyone know why or see this before ? Is there some better way to remove Dynamically created Objects......

TIA

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top