Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Harry Hunter   on Nov 09 In MS Office Category.

  
Question Answered By: Lionel Thomas   on Nov 09

I create a Form with a combobox  inside. When I press the button the
Form will popup.
The problem is when I try to enter something in the combobox, there
is a Compile Error saying" Method or data member not found"
Here is my code:
Private Sub combo_Change()
Dim x As Integer
Set myBar = CommandBars.Add(Name:="Custom1", Position:=msoBarPopup,
Temporary:=False)

With combo
.Controls.Add Type:=msoControlButton, ID:=3
.Controls(1).Style = msoButtonCaption
.Controls.Add Type:=msoControlComboBox
With .Controls(2)

.Style = msoComboLabel
.AddItem ("1st item")
.AddItem ("2nd item")
.AddItem ("3rd item")
x = combo.ListCount
End With
End With
myBar.ShowPopup

combo.Value = x
End Sub

Share: