PC Review


Reply
Thread Tools Rate Thread

Combobox listing display

 
 
=?Utf-8?B?UGhpbG9zb3BoYWll?=
Guest
Posts: n/a
 
      13th Jul 2007
The ComboBox1 doesn't initialize the list automatically. It only puts up a
blank ComboBox . Here is the code I am using:

Private Sub Form1_Load()
ComboBox1.Items.Add ("Open App1")
ComboBox1.Items.Add ("Open App2")
ComboBox1.Items.Add ("Open App3")
ComboBox1.Items.Add ("Open App4")
End Sub



 
Reply With Quote
 
 
 
 
=?Utf-8?B?QmrDtnJu?=
Guest
Posts: n/a
 
      13th Jul 2007
I asume that the combox is on a userform so try this:

Private Sub UserForm_Initialize()
ComboBox1.AddItem ("Open App1")
ComboBox1.AddItem ("Open App2")
ComboBox1.AddItem ("Open App3")
ComboBox1.AddItem ("Open App4")
End Sub

//Björn
"Philosophaie" skrev:

> The ComboBox1 doesn't initialize the list automatically. It only puts up a
> blank ComboBox . Here is the code I am using:
>
> Private Sub Form1_Load()
> ComboBox1.Items.Add ("Open App1")
> ComboBox1.Items.Add ("Open App2")
> ComboBox1.Items.Add ("Open App3")
> ComboBox1.Items.Add ("Open App4")
> End Sub
>
>
>

 
Reply With Quote
 
=?Utf-8?B?UGhpbG9zb3BoYWll?=
Guest
Posts: n/a
 
      13th Jul 2007
The change in the format still did not list the additem at startup. Is there
another subroutine to initilize each combobox1 item?

"Björn" wrote:

> I asume that the combox is on a userform so try this:
>
> Private Sub UserForm_Initialize()
> ComboBox1.AddItem ("Open App1")
> ComboBox1.AddItem ("Open App2")
> ComboBox1.AddItem ("Open App3")
> ComboBox1.AddItem ("Open App4")
> End Sub
>
> //Björn
> "Philosophaie" skrev:
>
> > The ComboBox1 doesn't initialize the list automatically. It only puts up a
> > blank ComboBox . Here is the code I am using:
> >
> > Private Sub Form1_Load()
> > ComboBox1.Items.Add ("Open App1")
> > ComboBox1.Items.Add ("Open App2")
> > ComboBox1.Items.Add ("Open App3")
> > ComboBox1.Items.Add ("Open App4")
> > End Sub
> >
> >
> >

 
Reply With Quote
 
=?Utf-8?B?UGhpbG9zb3BoYWll?=
Guest
Posts: n/a
 
      13th Jul 2007


"Philosophaie" wrote:

> The change in the format still did not list the additem at startup. The problem maybe that the combobox is located on the Actual worksheet not on a userform connected with the worksheet. Can the combobox on the worksheet?>
> "Björn" wrote:
>
> > I asume that the combox is on a userform so try this:
> >
> > Private Sub UserForm_Initialize()
> > ComboBox1.AddItem ("Open App1")
> > ComboBox1.AddItem ("Open App2")
> > ComboBox1.AddItem ("Open App3")
> > ComboBox1.AddItem ("Open App4")
> > End Sub
> >
> > //Björn
> > "Philosophaie" skrev:
> >
> > > The ComboBox1 doesn't initialize the list automatically. It only puts up a
> > > blank ComboBox . Here is the code I am using:
> > >
> > > Private Sub Form1_Load()
> > > ComboBox1.Items.Add ("Open App1")
> > > ComboBox1.Items.Add ("Open App2")
> > > ComboBox1.Items.Add ("Open App3")
> > > ComboBox1.Items.Add ("Open App4")
> > > End Sub
> > >
> > >
> > >

 
Reply With Quote
 
=?Utf-8?B?UGhpbG9zb3BoYWll?=
Guest
Posts: n/a
 
      13th Jul 2007
The combobox is located on the actual worksheet not a userform. Can the
combobox be initiallized on the worksheet?

"Philosophaie" wrote:

> The change in the format still did not list the additem at startup. Is there
> another subroutine to initilize each combobox1 item?
>
> "Björn" wrote:
>
> > I asume that the combox is on a userform so try this:
> >
> > Private Sub UserForm_Initialize()
> > ComboBox1.AddItem ("Open App1")
> > ComboBox1.AddItem ("Open App2")
> > ComboBox1.AddItem ("Open App3")
> > ComboBox1.AddItem ("Open App4")
> > End Sub
> >
> > //Björn
> > "Philosophaie" skrev:
> >
> > > The ComboBox1 doesn't initialize the list automatically. It only puts up a
> > > blank ComboBox . Here is the code I am using:
> > >
> > > Private Sub Form1_Load()
> > > ComboBox1.Items.Add ("Open App1")
> > > ComboBox1.Items.Add ("Open App2")
> > > ComboBox1.Items.Add ("Open App3")
> > > ComboBox1.Items.Add ("Open App4")
> > > End Sub
> > >
> > >
> > >

 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      13th Jul 2007
Maybe you could use a macro that runs when the workbook is opened.

Sub Auto_Open()
with worksheets("sheet9999).combobox1
.additem "Open App1"
.additem "Open App2"
.additem "Open App3"
.additem "Open App4"
end with
end sub

Philosophaie wrote:
>
> The ComboBox1 doesn't initialize the list automatically. It only puts up a
> blank ComboBox . Here is the code I am using:
>
> Private Sub Form1_Load()
> ComboBox1.Items.Add ("Open App1")
> ComboBox1.Items.Add ("Open App2")
> ComboBox1.Items.Add ("Open App3")
> ComboBox1.Items.Add ("Open App4")
> End Sub
>
>


--

Dave Peterson
 
Reply With Quote
 
=?Utf-8?B?UGhpbG9zb3BoYWll?=
Guest
Posts: n/a
 
      13th Jul 2007
Copied exactly except sheet1 and it didn't work. Does the location of
combobox1 being on the worksheet rather than the userform?

"Dave Peterson" wrote:

> Maybe you could use a macro that runs when the workbook is opened.
>
> Sub Auto_Open()
> with worksheets("sheet9999).combobox1
> .additem "Open App1"
> .additem "Open App2"
> .additem "Open App3"
> .additem "Open App4"
> end with
> end sub
>
> Philosophaie wrote:
> >
> > The ComboBox1 doesn't initialize the list automatically. It only puts up a
> > blank ComboBox . Here is the code I am using:
> >
> > Private Sub Form1_Load()
> > ComboBox1.Items.Add ("Open App1")
> > ComboBox1.Items.Add ("Open App2")
> > ComboBox1.Items.Add ("Open App3")
> > ComboBox1.Items.Add ("Open App4")
> > End Sub
> >
> >

>
> --
>
> Dave Peterson
>

 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      13th Jul 2007
Did you correct my other typo--missing a closing double quote:

Sub Auto_Open()
with worksheets("sheet1").combobox1 '<-- added final " mark.
.additem "Open App1"
.additem "Open App2"
.additem "Open App3"
.additem "Open App4"
end with
end sub

Is it a combobox from the Control toolbox toolbar?

Is the combobox on Sheet1 (after the change)?

Did you put the code in a general module and run it from there?

When you say it didn't work, what did you try and how did it fail?


Philosophaie wrote:
>
> Copied exactly except sheet1 and it didn't work. Does the location of
> combobox1 being on the worksheet rather than the userform?
>
> "Dave Peterson" wrote:
>
> > Maybe you could use a macro that runs when the workbook is opened.
> >
> > Sub Auto_Open()
> > with worksheets("sheet9999).combobox1
> > .additem "Open App1"
> > .additem "Open App2"
> > .additem "Open App3"
> > .additem "Open App4"
> > end with
> > end sub
> >
> > Philosophaie wrote:
> > >
> > > The ComboBox1 doesn't initialize the list automatically. It only puts up a
> > > blank ComboBox . Here is the code I am using:
> > >
> > > Private Sub Form1_Load()
> > > ComboBox1.Items.Add ("Open App1")
> > > ComboBox1.Items.Add ("Open App2")
> > > ComboBox1.Items.Add ("Open App3")
> > > ComboBox1.Items.Add ("Open App4")
> > > End Sub
> > >
> > >

> >
> > --
> >
> > Dave Peterson
> >


--

Dave Peterson
 
Reply With Quote
 
=?Utf-8?B?UGhpbG9zb3BoYWll?=
Guest
Posts: n/a
 
      13th Jul 2007
Have tried using form: sub userform_initialize() method, inserting combobox1
on userform1. Tried both sub Auto_Open() and Workbook_open() methods
inserting combobox1 onto sheet1. I believe there is a boolean function or
syntax I am missing but just haven't found it yet. I have gotten
CommandButtons, ToggleButtons and Textboxes to work in VBA but this is
giving me the most problems. I also got comboboxes to work in Visual
Studio(VB.net).

"Dave Peterson" wrote:

> Did you correct my other typo--missing a closing double quote:
>
> Sub Auto_Open()
> with worksheets("sheet1").combobox1 '<-- added final " mark.
> .additem "Open App1"
> .additem "Open App2"
> .additem "Open App3"
> .additem "Open App4"
> end with
> end sub
>
> Is it a combobox from the Control toolbox toolbar?
>
> Is the combobox on Sheet1 (after the change)?
>
> Did you put the code in a general module and run it from there?
>
> When you say it didn't work, what did you try and how did it fail?
>
>
> Philosophaie wrote:
> >
> > Copied exactly except sheet1 and it didn't work. Does the location of
> > combobox1 being on the worksheet rather than the userform?
> >
> > "Dave Peterson" wrote:
> >
> > > Maybe you could use a macro that runs when the workbook is opened.
> > >
> > > Sub Auto_Open()
> > > with worksheets("sheet9999).combobox1
> > > .additem "Open App1"
> > > .additem "Open App2"
> > > .additem "Open App3"
> > > .additem "Open App4"
> > > end with
> > > end sub
> > >
> > > Philosophaie wrote:
> > > >
> > > > The ComboBox1 doesn't initialize the list automatically. It only puts up a
> > > > blank ComboBox . Here is the code I am using:
> > > >
> > > > Private Sub Form1_Load()
> > > > ComboBox1.Items.Add ("Open App1")
> > > > ComboBox1.Items.Add ("Open App2")
> > > > ComboBox1.Items.Add ("Open App3")
> > > > ComboBox1.Items.Add ("Open App4")
> > > > End Sub
> > > >
> > > >
> > >
> > > --
> > >
> > > Dave Peterson
> > >

>
> --
>
> Dave Peterson
>

 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      13th Jul 2007
Userform_initialize won't help if the stuff isn't on a userform.

I'd double check to see if the combobox is from the control toolbox toolbar and
also check the name.

If that doesn't help, I still haven't seen your description of what goes wrong.

Philosophaie wrote:
>
> Have tried using form: sub userform_initialize() method, inserting combobox1
> on userform1. Tried both sub Auto_Open() and Workbook_open() methods
> inserting combobox1 onto sheet1. I believe there is a boolean function or
> syntax I am missing but just haven't found it yet. I have gotten
> CommandButtons, ToggleButtons and Textboxes to work in VBA but this is
> giving me the most problems. I also got comboboxes to work in Visual
> Studio(VB.net).
>
> "Dave Peterson" wrote:
>
> > Did you correct my other typo--missing a closing double quote:
> >
> > Sub Auto_Open()
> > with worksheets("sheet1").combobox1 '<-- added final " mark.
> > .additem "Open App1"
> > .additem "Open App2"
> > .additem "Open App3"
> > .additem "Open App4"
> > end with
> > end sub
> >
> > Is it a combobox from the Control toolbox toolbar?
> >
> > Is the combobox on Sheet1 (after the change)?
> >
> > Did you put the code in a general module and run it from there?
> >
> > When you say it didn't work, what did you try and how did it fail?
> >
> >
> > Philosophaie wrote:
> > >
> > > Copied exactly except sheet1 and it didn't work. Does the location of
> > > combobox1 being on the worksheet rather than the userform?
> > >
> > > "Dave Peterson" wrote:
> > >
> > > > Maybe you could use a macro that runs when the workbook is opened.
> > > >
> > > > Sub Auto_Open()
> > > > with worksheets("sheet9999).combobox1
> > > > .additem "Open App1"
> > > > .additem "Open App2"
> > > > .additem "Open App3"
> > > > .additem "Open App4"
> > > > end with
> > > > end sub
> > > >
> > > > Philosophaie wrote:
> > > > >
> > > > > The ComboBox1 doesn't initialize the list automatically. It only puts up a
> > > > > blank ComboBox . Here is the code I am using:
> > > > >
> > > > > Private Sub Form1_Load()
> > > > > ComboBox1.Items.Add ("Open App1")
> > > > > ComboBox1.Items.Add ("Open App2")
> > > > > ComboBox1.Items.Add ("Open App3")
> > > > > ComboBox1.Items.Add ("Open App4")
> > > > > End Sub
> > > > >
> > > > >
> > > >
> > > > --
> > > >
> > > > Dave Peterson
> > > >

> >
> > --
> >
> > Dave Peterson
> >


--

Dave Peterson
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
ComboBox listing Columns =?Utf-8?B?UmF5?= Microsoft Access Form Coding 7 10th Jul 2006 05:57 PM
DataGridView with a ComboBox column error (listing objects) gsa Microsoft Dot NET Framework Forms 3 21st Jan 2006 03:46 PM
Display a combobox depending on another combobox Veli Izzet Microsoft Access 2 11th Aug 2005 07:25 AM
Making combobox listing containing values larger Todd Huttenstine Microsoft Excel Programming 2 21st Jan 2004 03:16 AM
SQL instance Listing in ComboBox =?Utf-8?B?Sm9obiBCYXJy?= Microsoft C# .NET 3 25th Nov 2003 09:30 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:46 AM.