Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-15-2015, 06:35 AM
brent chadwick brent chadwick is offline Help with if then statements Windows 8 Help with if then statements Office 2013
Advanced Beginner
Help with if then statements
 
Join Date: Mar 2015
Posts: 86
brent chadwick is on a distinguished road
Default

So, I'm really confused. When the drop-down menu is XX, I want the exit macro to create a new additional form field. Am I explaining correctly or not?
Reply With Quote
  #2  
Old 07-15-2015, 06:46 AM
macropod's Avatar
macropod macropod is offline Help with if then statements Windows 7 64bit Help with if then statements Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,375
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by brent chadwick View Post
So, I'm really confused. When the drop-down menu is XX, I want the exit macro to create a new additional form field.
Well, except for the 'XX', which you originally said was '1000', if you have a look at the document I provided, you'll see it does exactly that.

To determine where the dependent text formfield should go, a bookmark is needed. To that end, the document I provided has a bookmark named 'BkMk' at the destination. The macro likewise refers to that bookmark - not the dropdown's bookmark or any other formfield's bookmark. So, if you want to use the macro, you need to do likewise. Your bookmark name doesn't have to be 'BkMk' but, if you decide to use any other name, you must create the bookmark via Insert|Bookmark and edit the macro to refer to that name.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 07-15-2015, 10:06 AM
brent chadwick brent chadwick is offline Help with if then statements Windows 8 Help with if then statements Office 2013
Advanced Beginner
Help with if then statements
 
Join Date: Mar 2015
Posts: 86
brent chadwick is on a distinguished road
Default

OK, I finally got it. In the macro that inserts all of this stuff I have to create a bookmark for the new form field to go to. One more question and I'll stop bugging you-I would like to add default text to the new form field. How do I do that? You have been a great help, I have learned much. Too much to learn and so little time-Thanks
Reply With Quote
  #4  
Old 07-15-2015, 05:18 PM
macropod's Avatar
macropod macropod is offline Help with if then statements Windows 7 64bit Help with if then statements Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,375
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by brent chadwick View Post
I would like to add default text to the new form field. How do I do that?
You can do that by inserting after:
.FormFields.Add BmkRng, wdFieldFormTextInput
the line:
BmkRng.FormFields(1).TextInput.EditType wdRegularText, "My default text"
where "My default text" is whatever you want for the default.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 07-17-2015, 04:51 AM
brent chadwick brent chadwick is offline Help with if then statements Windows 8 Help with if then statements Office 2013
Advanced Beginner
Help with if then statements
 
Join Date: Mar 2015
Posts: 86
brent chadwick is on a distinguished road
Default

The code works great. With this drop-down though I have three additional form fields that are conditional. I have tried working with the code you wrote and I get several error codes. Suggestions?

Do you have a book/books that I can read on the VBA subject? I have Mastering VBA and on other on and both of them do not define terms etc. that I can understand. Suggestions? Thanks-
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with if then statements Multiple If statements, Jamal NUMAN Excel 16 11-15-2022 11:59 PM
Countif statements Alaska1 Excel 5 02-05-2015 07:55 PM
Help with if then statements Using IF statements stuwoolf Excel 2 01-10-2015 01:58 PM
Help with if then statements count if statements Alaska1 Excel 1 05-14-2014 08:21 AM
IF statements that shifts to right. kent Excel 0 01-19-2006 02:23 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:11 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