How do I remove al items from a combobox but leave the comboboxes text intact...
Also it should not create an error if there are no items in the list...
Printable View
How do I remove al items from a combobox but leave the comboboxes text intact...
Also it should not create an error if there are no items in the list...
use .clear to remove all items from list.
When you clear the list, add the text to a temp variable and set the text back after the list is cleard.
code examplpe with one combo and one button:
Hope this is what you were asking forCode:Private Sub Command1_Click()
Dim temp As String
temp = Combo1.Text
Combo1.Clear 'clear context of combo
Combo1.Text = temp 'set text of combo
End Sub
Private Sub Form_Load()
Dim intI As Integer
For intI = 0 To 10 'fill combo with item
Combo1.AddItem "string " & intI
Next intI
Combo1.Text = Combo1.List(0) 'set item1 as text
End Sub
------------------
On Error Goto Bed :0)
[email protected]
Hey OnError, can you tell me how to do that thing where the code is in smaller text with a border above and below? Sorry for being a thicky.
They have something here that they call ubb-tag's instead of html-tag's.
This page is from FAQ:can I usa html-tag's in my message? http://www.vb-world.net/ubb/ubbcode.html
And my on error goto bed :0)....
is set in my profile and then I check the "Show signature: include ......................... checkbox below.
And the smiling faces can you read about in FAQ:Smilies
Oooop's maybe that was some info that you already knew about ;)
By the way, wasn't there someone here who didn't like our missuse of ... ... etc :)
Good luck
------------------
On Error Goto Bed :0)
[email protected]
[This message has been edited by onerrorgoto (edited 11-23-1999).]
I must say that I think those block quotes of code is totally useless, because when you copy and paste the code into VB all the code end up on one line.
------------------
Joacim Andersson
[email protected]
[email protected]
www.YellowBlazer.com
It only seems to be a problem with IE5 it works fine for IE3 & 4.
------------------
Aaron Young
Analyst Programmer
[email protected]
[email protected]
I believe that if you click the "Edit" icon on someone's post, you will be able to copy what you need and have the formatting retained. You won't, of course, be able to actually edit the code.
------------------
Marty