Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-14-2015, 03:06 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


The bookmark named 'BkMk' is one you create in the document, via Insert|Bookmark. You can use another name, of course, but you need to use the same name in both the document and the macro.
Quote:
would it be easier to insert all of the form fields and delete the ones not used when the drop-down is chosen?
No, because you'd still have to be able to add them back in if the user changes their mind.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #2  
Old 07-15-2015, 04:27 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

If I run the macro in the doc you sent me, it works fine. If I change the "BkMk" to anything else if gives me the "Bookmark:XXX not found", and does not insert a form field. What am I missing here? Thanks-
Reply With Quote
  #3  
Old 07-15-2015, 04:32 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
If I run the macro in the doc you sent me, it works fine. If I change the "BkMk" to anything else if gives me the "Bookmark:XXX not found", and does not insert a form field. What am I missing here?
Please have another read of what I said:
Quote:
Originally Posted by macropod View Post
You can use another name, of course, but you need to use the same name in both the document and the macro.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #4  
Old 07-15-2015, 04:58 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

If I use it in the doc I'm working, and give it the bookmark of the drop-down menu, it erases the drop-down menu. If I give it the bookmark of any other form field in the doc, it erases and replaces that form field. So it is not giving an additional (new) form field. Thanks-
Reply With Quote
  #5  
Old 07-15-2015, 05:33 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
If I use it in the doc I'm working, and give it the bookmark of the drop-down menu, it erases the drop-down menu.
I wouldn't expect anything else! The dropdown's bookmark should most certainly be referenced in the code.
Quote:
If I give it the bookmark of any other form field in the doc, it erases and replaces that form field. So it is not giving an additional (new) form field.
Again, that's exactly what one should expect. As I said in a previous post:
Quote:
The bookmark named 'BkMk' is one you create in the document, via Insert|Bookmark
Obviously, if you're chnaging the macro to use a bookmark already assigned to another formfield, you're not using one you've created via this process.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #6  
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
  #7  
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
  #8  
Old 07-25-2015, 10:59 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

With a few minor mods this code works perfectly-Thanks. Have you or anyone you know created a pull-down menu in the Quick Access Toolbar?
Reply With Quote
  #9  
Old 07-25-2015, 02:41 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
Have you or anyone you know created a pull-down menu in the Quick Access Toolbar?
AFAIK that's not possible. Some items can be added via VBA, but not a dropdown.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
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 12:54 PM.


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