Associate a "table" with a shape?

Started by mbarron, March 28, 2009, 01:32:58 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

mbarron

Hi all,
I'm a relatively experienced Excel VBA programmer but very new to Visio VBA.  I've got a "can I do this" question that I'm hoping someone can help me with.

I want to create a new shape that represents a question in a questionnaire.  The shape will have some simple data associated with it (questionnaire number, questionnaire text, additional instructions text).  But my issue is that it also needs to have a variable number of response categories (e.g. male, female) and each response category has one or two simple pieces of information attached to it (e.g. response value and next question to ask based on response.  In other words "male, value=1 next question=3; female, value=2, next question=4").

I know that you can create a variable list type under shape data, but this doesn't really meet my needs (it implies whatever the selected value is applies to the shape, when I want all values in the list assigned to the shape).  Ideally, I want to give the user a view similar "columns" view you get with the standard database entity shape.

So my first question is: is what I'm seeking to do possible? (I'm almost certain it is)

Second question: Could someone point me in the right direction of where to start (I'm seeking to learn, so just a nudge towards where I should be looking would help)?

Third question: One option for where I thought I might start is just editting the "entity" shape into what I need since it includes a lot of functionality that I need (places all columns into the shape, changes column shape text based on user assigned attributes of that column).  Is there a way to find documentation on this shape and a way to edit it?

Thanks in advance for any help you can provide.

Martin



mmulvenna

To link data to a specfic shape you can use the the tool\addons\extras data base wizard.

If you want to get the data thru VBA using ADO look at this example http://visguy.com/vgforum/index.php?topic=761.msg3634#msg3634. The example only fills Combo boxes  in a vba form so you could process the data differently.

mbarron

Thanks for your help, but this is not exactly what I'm looking for.  Both the examples given above suggest a way to pull data from an outside source into Visio.  I'm specifically looking for a way to 'comfortably' enter data in Viso (to be stored either in Visio or in an outside source). 

This is for questionnaire construction.  For example
Q1 Are you male or female
1) male
2) female.
Where Q1 is question number, "are you male or female" is question text, male/female are the response categories, and one response category has the attributes of response text of "male" and the attribute of response value of "1"

The user workflow I envision would go something like this: a user drags a "question" shape onto a diagram.  The question shape holds information about the question such as question name, question number, and response categories.  The new shape prompts the user enters that data in a form. Question name and number are easy, but for response category, I need a table format that would allow the entering of a variable number of responses possibilities with several attribute variables for each response category.  Then each response category has a connector to the next question to be asked.

Can anyone point me in the direction of the form control I might use for such functionality?  Looking again at the included "entity" shape on the database model diagram (in visio2007), this has a lot of the functionality I'd like to mimick.  Most importantly, under the "columns" category is a table input control that I'd love to adapt for my project.  But rather than representing database table columns (with attributes of physical name, data type, required, etc, it would represent questionnaire response categories (with attributes such as response value and response text). 

Thanks again for a push in the right direction.
Martin

wapperdude

Very interesting.  So a question, which would be a shape, is dragged onto a page from a stencil, the shape has a set of multiple choice answers, each represented by a separate shape, which could be double clicked to trigger an event that would that shows the users response to the question.  The double click could trigger an add-on which would record the answer and do a variety of marvelous visual things, like graying out the non-selected answers. 

A customizable questionaire could be easily designed by dragging the desired question shapes into the document.  Is that the, uh, essence of your project?  I'm trying to frame it so appropriate responses may be rendered.
Visio 2019 Pro

mbarron

Sorry, that still not quite what I'm envisioning (but thanks for really thinking about my problem!)

This is purely a questionnaire DEVELOPMENT tool.  It is NOT meant as a way for individuals to respond to a questionnaire.  Instead, it is meant as a way for survey professionals to visualize and develop questionnaires.

As such, I was envisionning each question would one shape and it would have shape data attached representing all of the questionnaires properties (including the multiple, variable responses possible to the question).

There is another built-in Visio object that is close to what I'm envisionning.  It's the "class" shape on the "UML Static Structure" stencil.  It's one shape, just as a question will be.  Double clicking the shape brings up a window for data entering information related to the class, just as I envision for the question shape.  On the left hand there are categories of data, on right, where the data is entered.  And, most importantly, under the attributes category is a data entry control that looks like a table.  I would use a control like this for entering the response categories for a particular question and the related attributes of that response category.

I'm pretty sure I have the knowhow to link a form to a shape as is done for the "class" shape.  But I'm at a loss for how to include a table control (such as under the attributes category on the "class" shape) on a custom form.  If you can point me towards that piece, I think I'll be on my way.

thanks again for your help,
Martin