Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Could not set the Text property of a ComboBox on User Form.

What is combo box's .Style set to ?
If it is 2-List, change to 0-Combo.

NickhK

"??????? ?. ???????" wrote in message
...
The statement
ComboBox1.Text = "1,2,3"
yields to a run-time error. The ComboBox1.MatchEntry is fmMatchEntryNone,
and ComboBox1.MatchRequired is False . The "1,2,3" does not match any

entry
in the ComboBox1 at the time, but I want to show it in the edit field of

the
combo box.



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Could not set the Text property of a ComboBox on User Form.

Yes, that means you cannot set .Text to a value that is not in the list.

NickHK

"??????? ?. ???????" wrote in message
...
ComboBox1.Style equals to fmStyleDropDownList

"NickHK" ?????:

What is combo box's .Style set to ?
If it is 2-List, change to 0-Combo.

NickhK

"??????? ?. ???????" wrote in message
...
The statement
ComboBox1.Text = "1,2,3"
yields to a run-time error. The ComboBox1.MatchEntry is

fmMatchEntryNone,
and ComboBox1.MatchRequired is False . The "1,2,3" does not match any

entry
in the ComboBox1 at the time, but I want to show it in the edit field

of
the
combo box.






  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Could not set the Text property of a ComboBox on User Form.

Well this code errors as expected in my version of Excel 2002 :

Private Sub UserForm_Initialize()
With ComboBox1
.Style = fmStyleDropDownList
.AddItem "Item 1"
.AddItem "Item 2"
.AddItem "Item 3"
.AddItem "Item 4"

.Text = "Not in list"
End With
End Sub

but this not not :

Private Sub UserForm_Initialize()
With ComboBox1
.Style = fmStyleDropDownCombo
.AddItem "Item 1"
.AddItem "Item 2"
.AddItem "Item 3"
.AddItem "Item 4"

.Text = "Not in list"
End With
End Sub

Read the help on the .Style property.

NickHK

"??????? ?. ???????" wrote in message
...
Why? The ComboBox1.MatchEntry is fmMatchEntryNone, and
ComboBox1.MatchRequired is False. And it works fine in the Office 2002.

And
what You do suggest?

"NickHK" ?????:

Yes, that means you cannot set .Text to a value that is not in the list.

NickHK

"??????? ?. ???????" wrote in message
...
ComboBox1.Style equals to fmStyleDropDownList

"NickHK" ?????:

What is combo box's .Style set to ?
If it is 2-List, change to 0-Combo.

NickhK

"??????? ?. ???????" wrote in message
...
The statement
ComboBox1.Text = "1,2,3"
yields to a run-time error. The ComboBox1.MatchEntry is

fmMatchEntryNone,
and ComboBox1.MatchRequired is False . The "1,2,3" does not match

any
entry
in the ComboBox1 at the time, but I want to show it in the edit

field of
the
combo box.




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Could not set the Text property of a ComboBox on User Form. John Bundy Excel Programming 0 December 11th 06 11:58 PM
use of mouse track wheel on user form combobox... mjs Excel Programming 1 January 13th 05 01:50 AM
Cont' Value and Text Property of Combobox augustus Excel Programming 0 November 1st 04 10:18 PM
Do combobox allow user to enter text? Daniel[_14_] Excel Programming 0 September 1st 04 09:07 AM
User Form-error 1004 unless opened in sheet w/combobox data dpaulos[_2_] Excel Programming 2 January 27th 04 03:25 AM


All times are GMT +1. The time now is 12:18 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"