Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Kim K Kim K is offline
external usenet poster
 
Posts: 47
Default drop down box help please

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?
--
Thanks,,
Kim
  #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?



  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Kim K Kim K is offline
external usenet poster
 
Posts: 47
Default drop down box help please

ok I think I am seeing where this is going but I Need some help if you can
please clarify.

On the drop down box, I need to bookmarkit as MYDropDown? I set the macro
to run on entry as AOnOpen and on exit as AOnExit?

The field that I want to go to is a Legacy Text Form Field? It is
bookmarked as MyTest or My TExt2?

It is set to run on Entry and exit as AOnOpen and AOnExit as well?

Thanks in advance.

--
Thanks,,
Kim


"Greg Maxey" wrote:

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?




  #4   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

Kim,

You set the AOnExit macro run on the two fields that you want to validate or
act on. In this case it would be the dropdown (bookmark it as you wish and
change the code accordingly) and the textfield that can't be blank if ABC is
selected in the dropdown. Again, bookmark as you wish and change the code
accordingly. The AOnEntry macro should be set to run on entry to all
fields.

The way it is set up is that if A B or C is selected the the mandatory text
field is enabled. If D or E is selected then the mandatory text field is
disabled and skipped and the following field is selected.



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

"Kim K" wrote in message
...
ok I think I am seeing where this is going but I Need some help if you can
please clarify.

On the drop down box, I need to bookmarkit as MYDropDown? I set the macro
to run on entry as AOnOpen and on exit as AOnExit?

The field that I want to go to is a Legacy Text Form Field? It is
bookmarked as MyTest or My TExt2?

It is set to run on Entry and exit as AOnOpen and AOnExit as well?

Thanks in advance.

--
Thanks,,
Kim


"Greg Maxey" wrote:

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?






Reply
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 08:25 PM.

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

About Us

"It's about Microsoft Word"