Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.pagelayout
airhockeycanada airhockeycanada is offline
external usenet poster
 
Posts: 10
Default Entering Info in Form Fields

Good day!

I have developed a form with drop down menus in some places and free form
fields in others. However, there are a few places where having a combination
of the two would help.

For instance, I'd like to give the user a choice of either using the
selections in the drop down menu OR enter their own response free form in the
field.

How can this be done?

Thank you.

--
S. Ross
  #2   Report Post  
Posted to microsoft.public.word.pagelayout
Greg Maxey[_2_] Greg Maxey[_2_] is offline
external usenet poster
 
Posts: 668
Default Entering Info in Form Fields

Using legacy formfields (Word2003 and ealier) you can. You could use
ContentControls in Word2007 or a UserForm in any Word version (see:
http://gregmaxey.mvps.org/Create_and...a_UserForm.htm)

Using formfields about all you could do is provide and enable a text field
for when the user selects the appropriate "provide your own input" option in
a dropdown. For example the a dropdown may have the options A, B, C and
Other. You would provide and textfield named "Other" and use the following
entry and exit macros assigned to the Dropdown field:


Sub DDOnExit()
If ActiveDocument.FormFields("DropDown1").DropDown.Va lue = 4 Then
ActiveDocument.FormFields("Other").Enabled = True
Else
ActiveDocument.FormFields("Other").Result = ""
ActiveDocument.FormFields("Other").Enabled = False
End If
End Sub

Sub DDOnEnter()
ActiveDocument.FormFields("Other").Enabled = True
End Sub


airhockeycanada wrote:
Good day!

I have developed a form with drop down menus in some places and free
form fields in others. However, there are a few places where having a
combination of the two would help.

For instance, I'd like to give the user a choice of either using the
selections in the drop down menu OR enter their own response free
form in the field.

How can this be done?

Thank you.



  #3   Report Post  
Posted to microsoft.public.word.pagelayout
Jay Freedman Jay Freedman is offline
external usenet poster
 
Posts: 9,854
Default Entering Info in Form Fields

What you described is called a "combo box" (because it's a combination of a
dropdown control and a text entry control).

If you and all your users have Word 2007, you can insert a combo box content
control directly from the Developer tab of the ribbon. However, besides the
obvious objection that lots of users don't have Word 2007, content controls
don't mix very well with protected forms (now known by the euphemism "legacy
controls").

To make a combo box in a form that can be used in Word 2003 or earlier, you
have four possibilities. Three of them involve macros.

1. The macro-less version is simply to insert two form fields (a dropdown
and a text field) next to each other, and include some text to the effect of
"Please choose an item from the list or enter text in the box, but not
both." Most users will understand this; the others need to be beaten about
the head with a Nerf clue stick. ;-)

2. The next idea is to insert the same two fields in the form, but also
write exit macros for the fields. Make the dropdown's first item "Please
choose a value" or some such default. In the exit macro for the dropdown, if
the result isn't the default, then set the text field's result to the
default string (five nonbreaking spaces) and set its Enabled property to
False. In the exit macro for the text field, if the result isn't the default
string, then set the dropdown to its default result and set its Enabled
property to False. This scheme ensures that only one of the fields can be
filled at any one time.

3. Create a userform (a macro-driven custom dialog,
http://gregmaxey.mvps.org/Create_and..._UserForm.htm). One of the
controls you can put on a userform is a real combo box. In the form
document, put in only a text form field, and make its entry macro display
the userform; when the user clicks OK in the userform, the macro transfers
the text from the userform's combo box to the form document's text form
field.

4. On the Control Toolbox toolbar, there is a combo box control. This is an
ActiveX control that's rather difficult to use in Word (it's really intended
for use in a Web page). See
http://msdn2.microsoft.com/en-us/lib...ffice.10).aspx for help
with this. One drawback is that it doesn't retain the entered information
when you close the document, so you have to store the text in a document
variable when the document is saved, and get that variable and restore the
control's value when the document is reopened.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

airhockeycanada wrote:
Good day!

I have developed a form with drop down menus in some places and free
form fields in others. However, there are a few places where having a
combination of the two would help.

For instance, I'd like to give the user a choice of either using the
selections in the drop down menu OR enter their own response free
form in the field.

How can this be done?

Thank you.



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Link fields with identical info to "auto-fill" in a Word form? CarolZdc Microsoft Word Help 2 February 24th 12 07:02 AM
Entering fields for future dates? meganfelicity Microsoft Word Help 2 June 27th 07 09:33 AM
How do prevent creating new pg when entering info in form? Cindy Microsoft Word Help 1 August 4th 06 03:12 PM
entering merge fields into main document EF Mailmerge 2 March 11th 06 07:34 AM
How do I enter text into an existing table for entering info.such. jaybird61 Tables 1 January 19th 05 02:30 AM


All times are GMT +1. The time now is 05:23 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"