View Single Post
 
Old 08-02-2016, 07:55 AM
gmaxey gmaxey is offline Windows 7 32bit Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,427
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

Sam,

I don't know where that user interface came from but that is not a combobox it is a dropdown formfields. Comboboxes let you type in alternate text not part of the list.

You will need to set a macro to run on exit from the dropdown:

Code:
Sub ConvertQtrToMonths()
  With ActiveDocument
    .FormFields("Text1").Enabled = True
    .FormFields("Text1").Enabled = True
    .FormFields("Text1").Enabled = True
    Select Case .FormFields("Dropdown1").Result
      Case "Q1"
        .FormFields("Text1").Result = "January"
        .FormFields("Text2").Result = "February"
        .FormFields("Text3").Result = "March"
      Case "Q2"
        .FormFields("Text1").Result = "April"
        .FormFields("Text2").Result = "May"
        .FormFields("Text3").Result = "June"
      Case "Q3"
      
      Case "Q4"
      
    End Select
'    .FormFields("Text1").Enabled = False
'    .FormFields("Text1").Enabled = False
'    .FormFields("Text1").Enabled = False
  End With
lbl_Exit:
  Exit Sub
End Sub
If there is another field in your form then you can disable the three month text boxes. Otherwise you have to leave at least one enable so you will have somewhere to exit to.
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote