Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-11-2013, 04:54 AM
skrallemand skrallemand is offline Help, auto select drop down by another drop down value? Windows 7 64bit Help, auto select drop down by another drop down value? Office 2007
Novice
Help, auto select drop down by another drop down value?
 
Join Date: Aug 2013
Posts: 9
skrallemand is on a distinguished road
Default Help, auto select drop down by another drop down value?

Hi

Is it possible to auto select a content control drop down, based by the display name by another content control drop down value, that corresponds to that display name?



any help would be appreciated

Thanks
Reply With Quote
  #2  
Old 09-11-2013, 06:35 AM
skrallemand skrallemand is offline Help, auto select drop down by another drop down value? Windows 7 64bit Help, auto select drop down by another drop down value? Office 2007
Novice
Help, auto select drop down by another drop down value?
 
Join Date: Aug 2013
Posts: 9
skrallemand is on a distinguished road
Default

I found a solution
But how do I execute the code on exit of the first dropdown? and how do lock the second drop down from manuel user selection?

Sub Validate_ContentControl()
Dim oCC As ContentControl
Dim oControls As ContentControls
Dim OCCEntry As ContentControlListEntry
Set oControls = ActiveDocument.ContentControls
Set oCC = ActiveDocument.ContentControls(1)
For i = 1 To oCC.DropdownListEntries.Count
If oCC.DropdownListEntries.Item(i).Text = oCC.Range.Text Then
Set OCCEntry = oCC.DropdownListEntries.Item(i)
' Check the text against value - can be checked directly with text
If OCCEntry.Value = OCCEntry.Value Then
If oControls(2).Title = "Dropdown2" Then
Set oLE = oControls(2).DropdownListEntries.Item(i)
oLE.Select
Else
MsgBox "Error none found"
Exit Sub
End If
End If
End If
Next i
End Sub
Attached Files
File Type: zip Select CC drop down by another drop down.zip (26.6 KB, 10 views)
Reply With Quote
  #3  
Old 09-11-2013, 10:53 AM
gmaxey gmaxey is offline Help, auto select drop down by another drop down value? Windows 7 32bit Help, auto select drop down by another drop down value? Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,429
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
Default

Use the ThisDocument ContentControl_OnExit Event

Select Case ContentControl.Title
Case "Your CC Title"
YourTargetCC.LockContents = False
'Your Code
YourTargetCC.LockContents = True
End Select
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
  #4  
Old 09-11-2013, 11:55 AM
skrallemand skrallemand is offline Help, auto select drop down by another drop down value? Windows 7 64bit Help, auto select drop down by another drop down value? Office 2007
Novice
Help, auto select drop down by another drop down value?
 
Join Date: Aug 2013
Posts: 9
skrallemand is on a distinguished road
Default

Quote:
Originally Posted by gmaxey View Post
Use the ThisDocument ContentControl_OnExit Event

Select Case ContentControl.Title
Case "Your CC Title"
YourTargetCC.LockContents = False
'Your Code
YourTargetCC.LockContents = True
End Select
Thanks you are indeed a helpful person
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
drop down box dockta Word 1 03-25-2013 10:12 PM
Drop Down Form Help jwm1346 Word 3 07-31-2012 07:49 PM
Help, auto select drop down by another drop down value? Automatically select first item in drop-down? flackend Excel 4 08-29-2011 02:07 PM
Help, auto select drop down by another drop down value? Form Field - Drop down selection causing auto text chesspupil Word VBA 7 05-09-2010 05:43 AM
Drop down menus ncdc209 Word 0 01-04-2010 08:46 AM

Other Forums: Access Forums

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