Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-31-2016, 03:03 PM
Begadoc Begadoc is offline Drop down options and controls in a Word form Windows 7 64bit Drop down options and controls in a Word form Office 2013
Novice
Drop down options and controls in a Word form
 
Join Date: Nov 2013
Location: NW England
Posts: 20
Begadoc is on a distinguished road
Default Drop down options and controls in a Word form

I have a simple form with most fields using Plain Text Content Control. A few use Date Picker Content Control. The only other one I use is Drop-Down List Content Control for choice of names and for their addresses.



If the person filling in the form wishes to enter the date themselves they can simply click in the box and type the date, ignoring the option of the arrow that allows selection from a calendar.
However, if the person does not find the name they want in the Drop-Down List Content Control, they can't enter any data as you can with the date field.

Is there any way of allowing the user to either pick a name from the list or enter their own name?
Secondly, rather than have to select the address that goes with the name in the next field, can I automatically fill in the address that goes with the name, other than just using a single box for both name and address? If this single box method is the only way, how do I insert carriage returns into the lines of the address. (Tried ^p - doesn't work!).

Many thanks for considering my questions.

Ian
Reply With Quote
  #2  
Old 05-31-2016, 09:05 PM
gmayor's Avatar
gmayor gmayor is offline Drop down options and controls in a Word form Windows 10 Drop down options and controls in a Word form Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,138
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

Use a combo box rather than a list box to allow the user to enter values not in the list.

You will need macros to automatically insert addresses associated with listed items, but that creates other issues when using a combo box to allow users to enter a name, which is thus unlikely to be associated with an address. If you want multiple lines, you need a text box control.

There is a lot of useful information on content controls on Greg Maxey's web site - start with the basics at http://gregmaxey.com/word_tip_pages/..._controls.html then move on to http://gregmaxey.com/word_tip_pages/...om_events.html
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #3  
Old 05-31-2016, 10:17 PM
Guessed's Avatar
Guessed Guessed is offline Drop down options and controls in a Word form Windows 10 Drop down options and controls in a Word form Office 2013
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,164
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

You can use a macro to allow the user to add an entry to the dropbox. An example would be
Code:
Private Sub Document_ContentControlOnExit(ByVal aCC As ContentControl, Cancel As Boolean)
  Dim sName As String
  If aCC.Range.Text = "Add another..." Then
    sName = InputBox("What name do you want to add?")
      aCC.DropdownListEntries.Add sName
    aCC.Range.Text = sName
  End If
End Sub
Where is the address information going to come from? If there is a data store somewhere that can be read by a macro then you could populate the address automatically but we would need to know where that information is going to come from.

A return in vbaspeak is usually vbCr instead of ^p
aString = "some text" & vbCr & "some more text"
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #4  
Old 06-06-2016, 03:14 PM
Begadoc Begadoc is offline Drop down options and controls in a Word form Windows 10 Drop down options and controls in a Word form Office 2016
Novice
Drop down options and controls in a Word form
 
Join Date: Nov 2013
Location: NW England
Posts: 20
Begadoc is on a distinguished road
Default

Thank you Gents.
Reply With Quote
Reply

Tags
content control, forms



Similar Threads
Thread Thread Starter Forum Replies Last Post
Form with content controls - expands but at the bottom of the form louiseword Word 3 05-27-2016 12:47 AM
Drop down options and controls in a Word form Problem transferring form controls from excel to word pluqk Word 1 11-19-2015 07:23 PM
Form Controls - Calculation Options Perk Word 17 09-18-2015 06:55 AM
Drop down options and controls in a Word form Drop down lists options inq80 Excel 2 10-17-2014 08:05 AM
Word Forms - Active X Controls - Drop Down Menu Value Assignments AMackenzieFFCU Word 0 01-04-2013 08:25 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:57 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft