Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-18-2014, 07:18 PM
mrtinfl mrtinfl is offline form control Field - Drop down auto text Windows XP form control Field - Drop down auto text Office 2007
Novice
form control Field - Drop down auto text
 
Join Date: Dec 2011
Posts: 7
mrtinfl is on a distinguished road
Default form control Field - Drop down auto text

I am using word 2007 and form will be used in word 2010. I am doing a form, which will be protected and using a control drop down box. The drop down box is used for meal plans and needs to populate as 3 separate lines, breakfast, lunch, dinner. Is this possible? or is there another choice besides a drop down box. I have drop down box that states:

Meal Plan A
Meal Plan B
Meal Plan C



Once selected I would like it to auto text the following:

If Meal Plan A chosen:

Breakfast: 3 starch, 1 dairy, 1 fruit, 2 fats
Lunch: 3 protein, 3 starch, 1 veg, 1 fruit, 1 dairy, 2 fats
Dinner: 3 protein, 2 starch, 1 veg, 1 fruit, 1 dairy, 2 fats

(would like all of the beginnings to line up ie all the 3's)

and Meal Plan B has differences, but same concept. The format of 3 separate lines is important.

Thanks so much for any help that anyone can lend, have been at this for a while and cannot come up with anything to keep alignment, etc.
Reply With Quote
  #2  
Old 11-18-2014, 11:50 PM
gmayor's Avatar
gmayor gmayor is offline form control Field - Drop down auto text Windows 7 64bit form control Field - Drop down auto text Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,101
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 of
Default

It is fairly straightforward to do this. See the example attached. Obviously I don't know what the meal plans B and C are so I have made them all the same, but if you unlock the form and press ALT+F9 you will see the construction and you can make your changes to the plans. Note the three statements follow each other with no space between them.

The alignment is maintained with tabs. The default tabs are re-set at 2.25cm. You can change that as you wish to get the alignment you want.

Tab out of the dropdown field to make the change (for which you need at least two fields on the form).
Attached Files
File Type: docx Meals.docx (22.3 KB, 21 views)
__________________
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 11-19-2014, 12:31 AM
mrtinfl mrtinfl is offline form control Field - Drop down auto text Windows XP form control Field - Drop down auto text Office 2007
Novice
form control Field - Drop down auto text
 
Join Date: Dec 2011
Posts: 7
mrtinfl is on a distinguished road
Default

Thank you so much for your reply, i have been working on this for a while, but i am not quite sure where or how to insert in my macro i have developed. I have attached the form and you obviously will be able to see the macro and perhaps could help me with where to insert. The location of field is on the 3rd page. Again, will this work with the form protected?
Attached Files
File Type: docm RTC-ADRR-112014-test.docm (158.1 KB, 13 views)
Reply With Quote
  #4  
Old 11-19-2014, 01:55 AM
gmayor's Avatar
gmayor gmayor is offline form control Field - Drop down auto text Windows 7 64bit form control Field - Drop down auto text Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,101
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 of
Default

The 'code' I posted is not part of a macro. You cannot achieve exactly what you have attempted with a macro. You could use it to write to the cell directly, though that would need the form to be unlocked. In fact there is no need for a macro to do this. You can use a conditional field (or fields) and that is what I have posted. I have inserted it into your form so you can see how it works. Select a meal and tab out of the field. (I think I have the meals right but please check).

It also entailed setting the default tabs at a new value, which affects the whole form. You may need to check your tabs and apply paragraph format tabs as required.
Attached Files
File Type: docx RTC-ADRR-112014-test.docx (164.9 KB, 18 views)
__________________
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
  #5  
Old 11-19-2014, 05:02 AM
mrtinfl mrtinfl is offline form control Field - Drop down auto text Windows XP form control Field - Drop down auto text Office 2007
Novice
form control Field - Drop down auto text
 
Join Date: Dec 2011
Posts: 7
mrtinfl is on a distinguished road
Default

I cannot say thank you enough. This was the first form that I had to reconstruct from something that someone else started and that had me stumped. Thanks again, you are a wonderful person.
Reply With Quote
  #6  
Old 11-19-2014, 06:57 AM
gmayor's Avatar
gmayor gmayor is offline form control Field - Drop down auto text Windows 7 64bit form control Field - Drop down auto text Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,101
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 of
Default

You are welcome Please mark the thread as solved.
__________________
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
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
form control Field - Drop down auto text Adding auto text to end of content control field ksigcajun Word VBA 4 10-13-2014 05:37 AM
form control Field - Drop down auto text MS WORD 2007 - Content Control versus Text Form Field question chamdan Word VBA 2 11-12-2013 09:51 PM
form control Field - Drop down auto text Form Field Drop Down List James Ayers Word 3 07-14-2013 07:53 PM
Word Form/ActiveX drop down menu/value in a different field AMackenzieFFCU Word VBA 1 01-14-2013 07:48 AM
form control Field - Drop down auto text Form Field - Drop down selection causing auto text chesspupil Word VBA 7 05-09-2010 05:43 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:05 AM.


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