Linking Combo Boxes with Data

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I will be creating a powerpoint slide with unique shape names. I will also be
populating the text values from a sql server database. All that's good.

I want to be able to give the user the ability to select a value from a
combo box and then save it back to the database. I know of a way which would
be to loop through the shapes and based on the shape.name, put the text value
in the database. Is there a better, smarter way?
 
Matthewmark said:
I will be creating a powerpoint slide with unique shape names. I will also be
populating the text values from a sql server database. All that's good.

I want to be able to give the user the ability to select a value from a
combo box and then save it back to the database. I know of a way which would
be to loop through the shapes and based on the shape.name, put the text value
in the database. Is there a better, smarter way?

I think you left out a step here?

I didn't follow you on the leap from saving a user-chosen value back to a
database to what happens with the shapes and text value ... what text value ...
back in the database.

In any case, it's quite fast to step through all the shapes on a slide and find
one of the right name, so if that's what you have in mind, it might work fine.

Or if you don't want to display the text itself, you can apply it as a tag to
the named shape and retrieve it instead of the shape's text.
 
What I am referring to is, as you said loop through the shapes and get the
text with the shape.name. Having already saved the shape.name with other Keys
in the database, I simply update the table with the what I call text.value.
Whatever the property is called for when using a combo box.

thanks
 
Iterating through the shapes is the right way to do this. As Steve
hints at using tags on the shapes is more powerful than using the
actual shape.name since you can have lots of tags on a shape but only
one name. Check the tag property in the VBA help file.

Brian Reilly, MVP
 
Back
Top