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

How to get rid of the current selection in the combo box? 1

Status
Not open for further replies.

shelbytll

Programmer
Dec 7, 2001
135
SG
How do I clear the selection in a combo box?
For example, after I made my selections, i would like to click on a button and remove all list item. I am able to remove the list items. However, i can't get rid of the current selection. Can anyone show me the code? Thanks. I am a clever newbie...[peace]
 
HI
If you have a bound control value to this combo box.., set the controls value to empty.
For example.. m.STATEid is the bound control.., when you reinitialise with empty form.. set this m.stateId to empty value.
Hope this helps :) ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
Clear Method
Clears the contents of a ComboBox or ListBox control.

For the Clear method to have an effect, the RowSourceType property must be set to 0 (None).
Attitude is Everything
 
Use the Selected property:

MyForm.List1.Selected(1) = .F.

Where (1) is the number of the item to deselect.
To deselect all:

FOR nIndex = 1 TO MyForm.List1.ItemCount
MyForm.List1.Selected(nIndex) = .F.
NEXT
Dave S.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top