Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-27-2011, 08:43 AM
vstarc16 vstarc16 is offline If field Windows XP If field Office 2003
Novice
If field
 
Join Date: Mar 2011
Posts: 3
vstarc16 is on a distinguished road
Default If field

I apologize I this was previously answered but I did not managed to find it.



I have a form with the dropdown box 'Sex' (male/female)

and multiple dependant IF Fields that change only when I click on them and select Update field. What I need is all of them to change automatically when value of the Sex Dropdown Box is selected.

I am an Open Office user where such update happens automatically; unfortunately I need to implement this form in MS Word and was not able to find a solution. I would appreciate any help.


Vanja
Reply With Quote
  #2  
Old 07-27-2011, 03:00 PM
gmaxey gmaxey is offline If field Windows XP If field Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,429
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

You can update all fields in a document by calling the following macro from your dropdown change event:

Public Sub UpdateAllFields()
Dim rngStory As Word.Range
Dim lngJunk As Long
Dim oShp As Shape
lngJunk = ActiveDocument.Sections(1).Headers(1).Range.StoryT ype
For Each rngStory In ActiveDocument.StoryRanges
'Iterate through all linked stories
Do
On Error Resume Next
rngStory.Fields.Update
Select Case rngStory.StoryType
Case 6, 7, 8, 9, 10, 11
If rngStory.ShapeRange.Count > 0 Then
For Each oShp In rngStory.ShapeRange
If oShp.TextFrame.HasText Then
oShp.TextFrame.TextRange.Fields.Update
End If
Next
End If
Case Else
'Do Nothing
End Select
On Error GoTo 0
'Get next linked story (if any)
Set rngStory = rngStory.NextStoryRange
Loop Until rngStory Is Nothing
Next
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
  #3  
Old 07-30-2011, 05:51 AM
vstarc16 vstarc16 is offline If field Windows XP If field Office 2003
Novice
If field
 
Join Date: Mar 2011
Posts: 3
vstarc16 is on a distinguished road
Default

Many thanks.

Vanja
Reply With Quote
  #4  
Old 09-25-2011, 05:36 AM
macropod's Avatar
macropod macropod is offline If field Windows 7 64bit If field Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

If it's a formfield, all you should need to do is to check the 'Sex' dropdown box's 'calculate on exit' property.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 10-03-2011, 02:39 PM
vstarc16 vstarc16 is offline If field Windows XP If field Office 2003
Novice
If field
 
Join Date: Mar 2011
Posts: 3
vstarc16 is on a distinguished road
Default

All fields are formfields, and 'calculate on exit' is checked for Sex field, but other fields does not change when Sex value is changed.

Vanja
Reply With Quote
  #6  
Old 10-04-2011, 01:51 AM
macropod's Avatar
macropod macropod is offline If field Windows 7 64bit If field Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Unless you can show us the field coding you're using (eg by attaching a stripped down document to a post), it's difficult for anyone to offer more help.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
If field ASK and REF field problem ilkks Word 3 05-26-2011 01:58 AM
How to refer a field in another field DaveSmith Word 0 08-24-2010 06:44 PM
Field Help BChianciola Word 0 11-09-2009 01:14 PM
Infopath field mjv Misc 0 12-27-2008 08:19 AM
If field Printing BCC field John Strung Outlook 4 11-22-2005 04:48 PM

Other Forums: Access Forums

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