Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-13-2014, 11:12 PM
nathan1986 nathan1986 is offline VBA Script to run macros based on the dropdown value Windows 7 64bit VBA Script to run macros based on the dropdown value Office 2010 64bit
Novice
VBA Script to run macros based on the dropdown value
 
Join Date: May 2014
Posts: 1
nathan1986 is on a distinguished road
Default VBA Script to run macros based on the dropdown value

Hi


Im trying to run different macros based on individual value in a dropdown field

So basically if the value of the dropdown is accounting then the some check box should be checked

This is the code im using not sure what the error is

Private Sub Dropdown3()
With ActiveDocument

If .FormFields("Dropbox3").Result = "Accounting" Then

.FormFields("Check1").CheckBox.Value = True
.FormFields("Check2").CheckBox.Value = True
.FormFields("Check3").CheckBox.Value = True
.FormFields("Check6").CheckBox.Value = True
.FormFields("Check7").CheckBox.Value = True
.FormFields("Check8").CheckBox.Value = True
.FormFields("Check9").CheckBox.Value = True
.FormFields("Check11").CheckBox.Value = True
Reply With Quote
  #2  
Old 05-14-2014, 03:18 AM
macropod's Avatar
macropod macropod is offline VBA Script to run macros based on the dropdown value Windows 7 32bit VBA Script to run macros based on the dropdown value 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

Aside from the fact your posted code is missing the closing:
End If
End With
End Sub
statements, which I assume it has, your code looks OK. What is the error message and what code line, if any, if highlighted at that time?

PS: When posting code, please use the code tags. They're on the 'Go Advanced' tab at the bottom of this screen.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with VBA script nsyrax Word VBA 1 01-18-2014 03:38 AM
VBA Script to run macros based on the dropdown value Outlook Script Help TheInfinetGroup Outlook 1 03-02-2013 07:43 AM
Add Shared Calendar using script Antros Outlook 0 03-15-2012 01:01 PM
Macro to populate a text form field based on dropdown selection koloa Word 0 10-20-2011 11:52 AM
[ask] about VB Script + Ms. Project anak_baru Project 2 03-10-2009 01:42 AM

Other Forums: Access Forums

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