Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-15-2014, 09:25 PM
jec1 jec1 is offline VBA error Content Control On Exit Windows 7 32bit VBA error Content Control On Exit Office 2013
Advanced Beginner
VBA error Content Control On Exit
 
Join Date: Jan 2012
Posts: 84
jec1 is on a distinguished road
Default VBA error Content Control On Exit

Hi, have attached form with vba error. Trying to combine OnExit code.

My preference is to parse dropdown method onexit Content Controls. If I select display value "Fred Smith" I would prefer that the "Email" address is inserted fsmith@gardens.com not display name "Fred Smith" and then "Name" content control is filled in at end of document using "Display value" or parse value "Name". Is this easier.

I altered my parsed listed to be:
Display Value Value
email address fred smith|xxx|xxxx
email address john smith|xxx|xxxx

Would prefer to be able to use below format:

Fred Smith fsmith@gardens.com|Fred John Smith|0555 111 222

When display value is selected the Email address is inserted not the display value in most cases. Then the Name (which is display value in this case) is inserted in "Name" content control at end of document.

What is best approach please?



?



jec
Attached Files
File Type: zip Transcript Order Form LC_Oct 2012 v1.dotm.zip (65.8 KB, 15 views)

Last edited by jec1; 08-15-2014 at 11:41 PM.
Reply With Quote
  #2  
Old 08-15-2014, 10:30 PM
macropod's Avatar
macropod macropod is offline VBA error Content Control On Exit Windows 7 32bit VBA error Content Control On Exit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
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

Without wanting to place too fine a point on it, you've omitted 'ActiveDocument' before '.SelectContentControlsByTitle'.

PS: Instead of providing links to other sites, which makes accessing those files subject to the vagaries of how those other sites are running, please attach directly any files relevant to this forum. You do this via the paperclip symbol on the 'Go Advanced' tab at the bottom of this screen.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 08-15-2014, 11:43 PM
jec1 jec1 is offline VBA error Content Control On Exit Windows 7 32bit VBA error Content Control On Exit Office 2013
Advanced Beginner
VBA error Content Control On Exit
 
Join Date: Jan 2012
Posts: 84
jec1 is on a distinguished road
Default

Macropod well what can I say doh! Removes error but won't place Name CC content. That is fixed I now get a SHIFTTABKEYS error intermittently. Thank you.
Reply With Quote
  #4  
Old 08-15-2014, 11:58 PM
macropod's Avatar
macropod macropod is offline VBA error Content Control On Exit Windows 7 32bit VBA error Content Control On Exit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
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

There are still some pretty basic issues to deal with, such as :
lbl_Exit:
Exit Sub
as the 2nd & 3rd lines in your ContentControlOnExit sub. In other words, it exits without ever even trying to do any processing...
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 08-16-2014, 04:08 PM
jec1 jec1 is offline VBA error Content Control On Exit Windows 7 32bit VBA error Content Control On Exit Office 2013
Advanced Beginner
VBA error Content Control On Exit
 
Join Date: Jan 2012
Posts: 84
jec1 is on a distinguished road
Default

Yes correct. I am combining two pieces of code. I will do my dropdowns one at time if I can't combine the codes without too much fiddling.
Thank you for help.
Reply With Quote
  #6  
Old 08-16-2014, 08:14 PM
macropod's Avatar
macropod macropod is offline VBA error Content Control On Exit Windows 7 32bit VBA error Content Control On Exit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
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

If your dropdowns are meant to respond to the updates of more than the one content control, though, they'll need to share the same ContentControlOnExit sub, so you'll need to incorporate the logic for each one into that - you can't have more than one ContentControlOnExit sub.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA error Content Control On Exit Move to next content control cksm4 Word VBA 13 07-02-2019 07:48 PM
VBA error Content Control On Exit Deleting a table from a content control -- preserving the content control BrainSlugs83 Word Tables 8 11-14-2013 03:06 AM
VBA error Content Control On Exit Content control problem Anja Word 2 10-16-2013 09:56 AM
VBA error Content Control On Exit Hierarchical content control ntjson Word VBA 1 04-04-2013 12:07 AM
VBA error Content Control On Exit Content control titles jillapass Word VBA 3 05-29-2012 06:11 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:05 PM.


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