Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-12-2016, 08:27 AM
cjkmarx cjkmarx is offline Creating and Referencing Drop Down Text Boxes in VBA code Windows 10 Creating and Referencing Drop Down Text Boxes in VBA code Office 2013
Novice
Creating and Referencing Drop Down Text Boxes in VBA code
 
Join Date: Dec 2016
Posts: 1
cjkmarx is on a distinguished road
Default Creating and Referencing Drop Down Text Boxes in VBA code


I have a word document that was originally created in Word 2010 and it has three drop down list boxes and in the VBA code I have the following code:

Code:
Public Sub Document_Open()
With Me.RevisedTotalDropDown
  .AddItem "0-700k"
  .AddItem "700k-750k"
  .AddItem "750k-10M"
  .AddItem "10M+"
End With
 
With Me.adminMod
  .AddItem "Yes"
  .AddItem "No"
End With
 
With Me.ForeignSupplier
  .AddItem "Yes"
  .AddItem "No"
End With
 
With Me.Subk_Type
  .AddItem "Choose One:"
  .AddItem "FFP (Firm Fixed Price)"
  .AddItem "FP-LOE (Fixed Price, Level of Effort)"
  .AddItem "CPAF (Cost Plus Award Fee)"
  .AddItem "CPAF-LOE (Cost Plus Award Fee, Level of Effort)"
  .AddItem "CPFF (Cost Plus Fixed Fee)"
  .AddItem "CPFF-LOE (Cost Plus Fixed Fee, Level of Effort)"
  .AddItem "T&M (Time and Materials)"
  .AddItem "LH (Labor Hour)"
  .AddItem "Other (Discuss Below)"
End With
End Sub
This has worked fine for over a year even when we first upgraded to Word 2013 it worked fine, but suddenly on some computers it is no longer working. I am getting an Compile error: Method or data member not found. It is erroring on the Me.RevisedTotalDropDown, Me.adminMod, and Me.Subk_Type. It is no longer recognizing the drop down list boxes. What could have caused this to happen and how can I fix this issue? I am thinking that it may be a Word or Office update that is causing the issue. Any ideas? Thanks!

Last edited by macropod; 12-12-2016 at 01:19 PM. Reason: Added code tags & formatting
Reply With Quote
  #2  
Old 12-12-2016, 03:20 PM
Guessed's Avatar
Guessed Guessed is offline Creating and Referencing Drop Down Text Boxes in VBA code Windows 10 Creating and Referencing Drop Down Text Boxes in VBA code Office 2013
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,977
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Methinks the code has been tampered with.

If Me.RevisedTotalDropDown throws an error then I can tell that Me doesn't contain a control called RevisedTotalDropDown.

Your subroutine is called Document_Open which implies it runs automatically when a document is opened. I note that this code is not opening a userform.

However, your code includes Me.controlname items which are used inside a UserForm module and the 'Me' refers to the userform itself. I would have expected your userform code to sit inside a macro named UserForm_Initialize and it would then run after the userform has been shown.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
Reply

Tags
data member, drop down lists, methods



Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating and Referencing Drop Down Text Boxes in VBA code Drawing lines between text boxes which have actual text within the text boxes RHODIUM Word 6 10-01-2016 04:43 PM
Creating and Referencing Drop Down Text Boxes in VBA code Is there a way to anchor drop-down content control boxes so entering text doesn't change formatting? TzarChasm Word 7 04-14-2016 06:28 PM
creating a code to create dynamic text in word ah8471 Word VBA 1 12-29-2015 10:52 PM
Creating and Referencing Drop Down Text Boxes in VBA code Changing the placeholder text for drop down boxes DeadBatteries Word 1 08-24-2012 09:09 AM
Creating and Referencing Drop Down Text Boxes in VBA code Dynamically creating new drop down boxes. dmncs Word VBA 1 05-06-2012 09:29 PM

Other Forums: Access Forums

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