Solved

Clearing a combo box

Posted on 2002-04-19
4
1,472 Views
Last Modified: 2012-08-13
I want to reset the selected item in a combo box. I am letting the user select an item then this item is written to a DB and the combo reset. I am using VB6 and the style of the combo is 2 - drop down list

Thanks

merlin007
0
Comment
Question by:merlin007
  • 2
4 Comments
 
LVL 43

Expert Comment

by:TimCottee
ID: 6953949
Use

Combo1.RemoveItem Combo1.ListIndex

0
 
LVL 2

Accepted Solution

by:
UncleMatt earned 50 total points
ID: 6953950
try cbowhatever.listindex = -1

Matt.
0
 

Author Comment

by:merlin007
ID: 6953998
Thanks Uncle Matt
TimCoffee - the RemoveItem take the selection from the list completely. I probably did not explain the question properly, Thanks

Regards

Merlin007
0
 
LVL 43

Expert Comment

by:TimCottee
ID: 6954028
You probably did merlin, I just misinterpreted it. Anyway you got a good answer from UncleMatt.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question