Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
ah ah is offline
external usenet poster
 
Posts: 43
Default Mapping based on the drop down selection

Hi;

I have a drop down list for the user to select the "country" in my form now.
Appreciate if someone could advice me on how to get the following done:

a) The word "Passport" to be appeared automatically in 1 of the coumn in my
table when I select a country called "Singapore"
b) The word "Health Plan" to be appered in the same column when I select a
country called "UK"

As a result of that, different wording needs to be appered automatically
when I select different country and etc

Please advice.
Thanks
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Mapping based on the drop down selection

You would have to run a macro on exit from the dropdown form field and you
would need text form field(s) where you want to display the information eg

Sub OnExitDD1()
'fills text field based on content of _
dropdown field

Dim oFld As FormFields
Set oFld = ActiveDocument.FormFields
Select Case oFld("Dropdown1").Result
Case Is = "Singapore"
oFld("Text1").Result = "Passport"
Case Is = "UK"
oFld("Text1").Result = "Health Plan"
Case Else
'Do nothing
End Select
End Sub


Create a statement for each entry in your list
eg

Case Is = "Singapore"
oFld("Text1").Result = "Passport"

http://www.gmayor.com/installing_macro.htm

Note that a dropdown field will only hold 25 entries. If you need more then
you would have to consider instead the use of listboxes in userforms
Word MVP FAQ - Userforms http://word.mvps.org/FAQs/Userforms.htm

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


"ah" wrote in message
...
Hi;

I have a drop down list for the user to select the "country" in my form
now.
Appreciate if someone could advice me on how to get the following done:

a) The word "Passport" to be appeared automatically in 1 of the coumn in
my
table when I select a country called "Singapore"
b) The word "Health Plan" to be appered in the same column when I select a
country called "UK"

As a result of that, different wording needs to be appered automatically
when I select different country and etc

Please advice.
Thanks



  #3   Report Post  
Posted to microsoft.public.word.docmanagement
ah ah is offline
external usenet poster
 
Posts: 43
Default Mapping based on the drop down selection

Hi;

Thanks for your help. It managed to display the default wording based on
the country that I select now. However, it allows the users to change and
overwrite the default value as it is a text field.

I understand that I could untick the "fill in enabled" option to block this,
but there are some contries that I want the user to key in their value
manually into the same field.

Please advice whether I could add the "Fill in enabled" coding into the
macro to allow the user to overwrite the default value when they select a
country called "Singapore", and disallow them from overwrite the value when
they select a country called "UK".

Please advice.

"Graham Mayor" wrote:

You would have to run a macro on exit from the dropdown form field and you
would need text form field(s) where you want to display the information eg

Sub OnExitDD1()
'fills text field based on content of _
dropdown field

Dim oFld As FormFields
Set oFld = ActiveDocument.FormFields
Select Case oFld("Dropdown1").Result
Case Is = "Singapore"
oFld("Text1").Result = "Passport"
Case Is = "UK"
oFld("Text1").Result = "Health Plan"
Case Else
'Do nothing
End Select
End Sub


Create a statement for each entry in your list
eg

Case Is = "Singapore"
oFld("Text1").Result = "Passport"

http://www.gmayor.com/installing_macro.htm

Note that a dropdown field will only hold 25 entries. If you need more then
you would have to consider instead the use of listboxes in userforms
Word MVP FAQ - Userforms http://word.mvps.org/FAQs/Userforms.htm

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


"ah" wrote in message
...
Hi;

I have a drop down list for the user to select the "country" in my form
now.
Appreciate if someone could advice me on how to get the following done:

a) The word "Passport" to be appeared automatically in 1 of the coumn in
my
table when I select a country called "Singapore"
b) The word "Health Plan" to be appered in the same column when I select a
country called "UK"

As a result of that, different wording needs to be appered automatically
when I select different country and etc

Please advice.
Thanks




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
Auto completion based on selection of Drop down menu item (Word) lisa Tables 3 January 21st 10 02:55 AM
Insert text based on userform selection Ted New Users 1 August 23rd 07 08:50 PM
change color of cell based upon form drop down selection Tim Doyle Tables 1 October 27th 06 07:41 PM
Hide a row in a table based upon a previous selection [email protected] Tables 6 June 7th 06 02:46 PM
define a style based on a selection Jessica Microsoft Word Help 2 November 29th 05 02:27 AM


All times are GMT +1. The time now is 10:44 AM.

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"