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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reset combo box 3

Status
Not open for further replies.

Igeeky1

MIS
Mar 17, 2000
8
US
How can I reset a combo box? (style 2, drop down list)<br>
<br>
I want to be able to reset the cbobox to its original status when the program starts (nothing displayed). Can't use cboBox.Text = Empty because get error: read only.<br>
<br>
Please help<br>
<br>
Thanks<br>
<br>
Mark
 
Well one way (maybe no the best way) is to put a blank record in your combo box list and select it.<br>
Or maybe Delete all items in the list and re-add them<br>
Which may have the effect of choosing a blank one.<br>
<br>
If you delete them it works best backwards<br>
i.e.<br>
<br>
for a = combo1.listcount to 1 step -1<br>
' delete items<br>
Next<br>
<p> DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br>
 
set the listindex property to -1<br>
<p>nick bulka<br><a href=mailto:nick@bulka.com>nick@bulka.com</a><br><a href= > </a><br>
 
A better way to empty a combo box (which I know wasn't the original question) is to use the Clear method.<br>
<br>
Call Combo1.Clear<br>
<br>
Mike<br>
<p>Mike Lacey<br><a href=mailto:Mike_Lacey@Cargill.Com>Mike_Lacey@Cargill.Com</a><br><a href= Cargill's Corporate Web Site</a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top