How do I populate combo box on a PPT slide with choice list?

D

Dusty

I have created a combo box on my Powerpoint slide using an action button.
How do I populated the user selections?
 
D

David M. Marcovitz

Sub AddComboBoxItems()
Slide1.ComboBox1.AddItem ("yes")
Slide1.ComboBox1.AddItem ("no")
End Sub

adds the items "yes" and "no" to ComboBox1 on Slide1. Is this what you are
after?

--David

--
David M. Marcovitz
Microsoft PowerPoint MVP
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
 
D

Dusty

yes, but still can't get it to work. I have:

Private Sub ComboBox1_Change()
Sub AddComboBoxItems()
Slide1.ComboBox1.AddItem ("Yes")
Slide1.ComboBox1.AddItem ("No")
Slide1.ComboBox1.AddItem ("Maybe")
End Sub
End Sub

have also tried

Sub AddComboBoxItems()
Slide1.ComboBox1.AddItem ("Yes")
Slide1.ComboBox1.AddItem ("No")
Slide1.ComboBox1.AddItem ("Maybe")
End Sub

am on Slide 1.

see no choices in the box. assume you can use the drop down box when in
Slide Show.
 
D

David M. Marcovitz

First of all, you can't have a Sub inside a Sub as you have there. The second
thing you listed will work. What you need is a way to trigger the macro. You
can create a button (Slide Show menu > Action Buttons) and assign it to run
the macro AddComboBoxItems. You said you wanted to use a macro to populate
the combo box. Is that really what you want, or do you just want to do it by
hand?
--David

David Marcovitz
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
 
B

Bill Dilworth

I little trick I started using in similar cases, is a mouse-over
action-setting on an object behind (and larger than) the combo box.


That way, as the mouse pointer comes close to the combobox, it checks if the
combo box is populated and, if not, does so.

Sub AmILoaded()
If Slide1.ComboBox1.ListCount < 4 Then
Slide1.ComboBox1.AddItem ("1")
Slide1.ComboBox1.AddItem ("2")
Slide1.ComboBox1.AddItem ("3")
Slide1.ComboBox1.AddItem ("4")
End If
End Sub


--
Bill Dilworth
A proud member of the Microsoft PPT MVP Team
Users helping fellow users.
http://billdilworth.mvps.org
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
yahoo2@ Please read the PowerPoint FAQ pages.
yahoo. They answer most of our questions.
com www.pptfaq.com
..
 
D

Dusty

What I really want is:
A form in Powerpoint that users can complete and send to us.
The form should have "drop downs" with choices for some fields.
Did I start asking questions when I was too deep?
Do the "drop downs" have to have underlying tables - like Access?
If yes, how do I link the table to the "drop down" box?
Should I use Combo Boxes or List Boxes?
 
D

David M. Marcovitz

I guess the answers to your questions depend how complicated this form
should be. If it is a very complex form with lots of values that will
regularly change over time, you might be best off to link it to an Access
database to get the values for the combo boxes. However, if it is
relatively simple, the solutions you have been given might be best. I
would imagine, having a slide at the beginning with a button that
continues to the next slide. This button also activates the macro that
populates all your combo boxes, but there are lots of ways to do this.

My suggestion to you is to focus on what you want to do, rather than how
you are going to do it. That is design the interface for this thing. Once
you have a clear idea of how the user will interact with your thing, you
can then figure out the technical side of how that will work. Your design
might need some minor adjustments based on what is possible and/or easy,
but you should be able to get help (here or professionally) to make it
work. This discussion has been confused because of the mixing of the
Design and Develop phases of your project.

--David

--
David M. Marcovitz
Microsoft PowerPoint MVP
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
 
Top