+ Reply to Thread
Results 1 to 2 of 2

Thread: if then statement in word form

  1. #1
    Registered User
    Join Date
    12-11-2009
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    30

    if then statement in word form

    Problem: I would like to add a single sentence to a document if a certain drop down box is selected.

    Apologies if this has been covered before, but I was unable to find anything in the forum.

    I have a form with a drop down list, that, when selected, I would like to have it update a text field. I have been able to find the vba to create cascading drop downs through a series of case statements, but am unable to recreate something similar for a text box, rather than a combo box.

    Can someone please assist with the code I've posted, below:

    Sub FLSA_Status()
        If ActiveDocument.FormFields("DropDown1").DropDown.Value = 0 Then
            ActiveDocument.FormFields("Text2").DropDown.ListEntries.Clear
            Exit Sub
         End If
         
         Select Case ActiveDocument.FormFields("Dropdown1").Result
            Case "Exempt"
                With ActiveDocument.FormFields("Text2").
                    .Add "This position is exempt"
                End With
                
         End Select
     End Sub
    Last edited by justinhampton81; 08-25-2011 at 02:16 PM.

  2. #2
    Forum Guru snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,151

    Re: if then statement in word form

    You'd better add code tags before....



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.2.0