Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-28-2013, 03:07 AM
Catty Catty is offline Document_ContentControlOnExit Windows 7 32bit Document_ContentControlOnExit Office 2010 32bit
Advanced Beginner
Document_ContentControlOnExit
 
Join Date: Nov 2013
Posts: 39
Catty is on a distinguished road
Post Document_ContentControlOnExit

Hi,

I have a set of dependant content controls (Master and Slave).


If Master.text = "NO" then Slave.text is set to "YES", then a msgbox displays and depending on the options selected from the msgbox the doc is disabled from
editing and the above content controls are locked from editing aswell. All the code is placed in the "Private Sub Document_ContentControlOnExit".

Even though the content controls are locked, a user can still "attempt" to change the text within (which will not change ofcourse), my issue is - when the user steps out of the content control the "Private Sub Document_ContentControlOnExit" is triggered again. How do I stop this or turn it off?

Any ideas?
Reply With Quote
  #2  
Old 11-28-2013, 05:32 PM
macropod's Avatar
macropod macropod is offline Document_ContentControlOnExit Windows 7 32bit Document_ContentControlOnExit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,355
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

Hi Catty,

Does your 'master' content control have a title or tag? If so, you can add a test of that to your ContentControlOnExit macro so it only runs the update code when that one is exited. Alternatively, you could test the lock status so it only runs the update code when an unlocked one is exited; that's still not going to be satisfactory, though, if you have other unlocked content controls.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 11-29-2013, 04:49 AM
Catty Catty is offline Document_ContentControlOnExit Windows 7 32bit Document_ContentControlOnExit Office 2010 32bit
Advanced Beginner
Document_ContentControlOnExit
 
Join Date: Nov 2013
Posts: 39
Catty is on a distinguished road
Thumbs up

Hi Paul,

Thanks for the response.

I used your advise and put an IF statement on the 'slave' content control to ensure that the ContentControlOnExit event is only triggered when the .ContentControls("Slave").LockContents = False.

This works beautifully.

Thanks!!
Reply With Quote
Reply

Thread Tools
Display Modes


Other Forums: Access Forums

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