Automated Reports from Questionnaire

E

Expando1

I'd like to generate a narrative report based on a questionnaire.

The questionnaire would have ask fields, drop down or check-box select
fields, fill-in fields, and text fields. For instance: Name: Smith, Age: 26,
Sex: Male, Do you have difficulty sleeping at night: Yes; Bedtime on
Weekdays: 10pm; Wake time on weekdays: 6am; Do you awaken at night: Yes;
Number of awakenings: 2; Duration of total awakenings: 1 hour. etc...,

The narrative report would be automatically generated at the completion of
the questionnaire and would read as follows: Mr. Smith is a 26 year old male
who has difficulty sleeping at night. He typically goes to bed at 10 pm and
wakes up at 6am. During the night he wakes up two times of one hour total
duration....

How can I created such a document--questionnaire and report which are so
linked? Please feel free to direct me to a tutorial or other resource as I
know it's a big question.
 
D

Doug Robbins - Word MVP

Is this questionnaire being distributed to other people for them to fill in,
or is it something that the same person would use regularly while asking
questions of the subject?

If the latter, I would use a userform in template that contained the
narrative and have the answers when entered into the userform, used to set
the values of variables in the document so that { DOCVARIABLE } fields that
were embedded in the narrative would, after the fields in the document were
updated, display the information required to complete the narrative

The narrative in the template would look like

{ DOCVARIABE varSubject }is a { DOCVARIABLE varAge } year old { DOCVARIABLE
varGender }
who has { DOCVARIABLE varSymptom }. He typically goes to bed at {
DOCVARIABLE varToBedTime } pm and
wakes up at { DOCVARIABLE varWakeTime }am. During the night he wakes up
{ DOCVARIABLE varNumber } times of { DOCVARIABLE varDuration } hour total
duration....

See the article "How to create a Userform" at:

http://word.mvps.org/FAQs/Userforms/CreateAUserForm.htm

In place of the code given in the example at the above site, you would use

With ActiveDocument
.Variables("varSubject").Value = txtSubjectName.Text
.Variables("varAge").Value = txtAge.Text
.Variables("varGender")
'etc
.Fields.Update
End With



--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
G

Graham Mayor

The most elegant way to do this would be to use a user form (or forms) Word
MVP FAQ - Userforms
http://word.mvps.org/FAQs/Userforms.htm to collect the data and to insert
the collected data into a report of the type you mention. The reporting is
easy enough - it's just a matter of passing the collected data to the
appropriate locations on the report - but the userform will take a little
thought.

Fellow MVP Greg Maxey has presented some simple tutorials on his web site
that you will find useful eg
http://gregmaxey.mvps.org/UserForm_Pass_Data.htm
http://gregmaxey.mvps.org/Populate_UserForm_ListBox.htm
http://gregmaxey.mvps.org/FormField_UserForm_ListBox.htm
http://gregmaxey.mvps.org/Interactive_UserForm_Checkboxes.htm
and maybe
http://gregmaxey.mvps.org/Validate_UserForm_TextEntry.htm

Another method, easier to create but a little more rigid in application is
to use a protected form associated with a macro to read the form fields and
pass the data to your report.

http://www.mousetrax.com/techpage.html#autoforms

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
E

Expando1

Thanks Doug and Graham! I'll give those all a view. Doug, to answer your
question, the forms will be filled out by different users--each patient
actually--while the report will be viewed by the back office, edited, and
made part of their medical chart. I just need a user friendly way to collect
this information. Right now we're using paper forms that they complete with
pen-in-hand and the next day we sit there with those paper forms in our laps
and type the information in to the narrative report.
 
E

Expando1

I have reviewed the linked tutorials and tried to work through them, but I'm
sad to say it's all above my capabilities at the moment. I don't have the
background to be able to write all the codes and macros needed to make my
this work. Right now I can't even get a practice form/document with only 2
fields to work properly.

Is there another way I can get this done such as a program I can use which
will ask me what I want to do and associate the macros and everything behind
the scenes for me?
 
G

Graham Mayor

Send me a list of the questions to the link on my web site home page and
I'll have a look what's involved.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top