Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Greg Maxey Greg Maxey is offline
external usenet poster
 
Posts: 285
Default drop down box help please

You need to have macros set to run on exit from your Dropdown field and
mandatory text field (MyDropDown and MyText in my example), and on entry to
all fields. MyText2 is the field after your mandatory text field.

Option Explicit
Public mstrFF As String
Public Sub AOnExit()
Dim oDoc As Word.Document
Set oDoc = ActiveDocument
With GetCurrentFF
Select Case .Name
Case Is = "MyDropDown"
Select Case .Result
Case Is = "A", "B", "C"
ActiveDocument.FormFields("MyText").Enabled = True
ActiveDocument.Bookmarks("MyText").Range.Fields(1) .Result.Select
Case Else
ActiveDocument.FormFields("MyText").Result = ""
ActiveDocument.FormFields("MyText").Enabled = False
ActiveDocument.Bookmarks("MyText2").Range.Fields(1 ).Result.Select
End Select
Case Is = "MyText"
If Len(.Result) 1 Then
mstrFF = .Name
End If
End Select
End With
End Sub
Public Sub AOnEntry()
Dim strCurrentFF As String
If LenB(mstrFF) 0 Then
ActiveDocument.Bookmarks(mstrFF).Range.Fields(1).R esult.Select
mstrFF = vbNullString
End If
End Sub

Public Function GetCurrentFF() As Word.FormField
With Selection
If .FormFields.Count = 1 Then
Set GetCurrentFF = .FormFields(1)
ElseIf .FormFields.Count = 0 And .Bookmarks.Count 0 Then
Set GetCurrentFF = ActiveDocument.FormFields _
(.Bookmarks(.Bookmarks.Count).Name)
End If
End With
End Function



--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.


Kim K wrote:
I have a word doc with one drop down that I would like to do as
follows: If the user drops down the box and the answer is A,b or C
then it will take them to the next field to further clarify the
answer and they can not move forward until that is answered. IF the
answer is D or E they can skip the next field for further
clarification. I hope this makes sense. Can anyone help please?



 
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Drop-down Menus won't drop down all the way Paul Microsoft Word Help 3 September 28th 07 03:01 PM
Drop List Options Dependent On Another Drop Down List Option Sidneychic.Admin Microsoft Word Help 9 July 24th 07 09:15 PM
Drop down form field added but nolist in drop down Roberta Microsoft Word Help 1 November 1st 06 03:54 PM
The drop down form field is not showing drop downs. Why? mindysue Microsoft Word Help 1 May 26th 05 09:43 PM
Drop-down List where items in drop-down list hyperlink to a webpage? gully New Users 4 April 24th 05 09:58 AM


All times are GMT +1. The time now is 07:58 AM.

Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"