Dropdown Field

F

Francis Ang

I have a dropdown and textbox fields in my document. When an item is
selected from the dropdown field, textbox get filled in automatically. eg. if
item 'apple' is selected, the textbox will be populated with 'green' and if
item 'strawberry' is selected, the textbox is pouplated with 'red', etc. Can
this be achieved without using VBA?

Any help is very much appreciated.

Thank you.
 
M

macropod

Hi Francis,

Yes, you can do this without vba.

With your dropdown formfield, make sure it:
1. has a bookmark name; and
2. is set to 'calculate on exit'.
You do this via the formfield properties.

Then, where you want the response to appear, insert a series of formula fields coded as:
{IF{REF Dropdown1} = "Apple" "Green"}
{IF{REF Dropdown1} = "Strawberry" "Red"}
etc, where 'Dropdown1' is you formfield's bookmark name. The fields can all be on one line - I've put each on its own line for
clarity.

Note: The field brace pairs (ie '{ }') for the above examples are created via Ctrl-F9 - you can't simply type them or copy & paste
them from this message.
 
G

Graham Mayor

Yes and no. You can colour conditional fields based on the result of a
dropdown, but not text form fields, for which you would need vba (see
http://www.gmayor.com/word_vba_examples.htm )

In the following example, colour the three conditional fields as required
and set the calculate on exit check box of the dropdown field.
{ IF { Dropdown1 } = "Apple" "This text is green" \*charformat }{ IF {
Dropdown1 } = "Strawberry" "This text is red" \*charformat }{ IF {
Dropdown1 } = "Blueberry" "This text is blue" \*charformat }

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
F

Francis Ang

Hi,

Thank you very much for the quick response. I followed your advice and did
the following -

Press Ctrl+F9 to get the {}
Put in the formula between the {}
The Dropdown field is set to 'calculate on exit'
Proctect the document.

When I select the item in the dropdown list, nothing happen! Did I do
something wrong?


macropod said:
Hi Francis,

Yes, you can do this without vba.

With your dropdown formfield, make sure it:
1. has a bookmark name; and
2. is set to 'calculate on exit'.
You do this via the formfield properties.

Then, where you want the response to appear, insert a series of formula fields coded as:
{IF{REF Dropdown1} = "Apple" "Green"}
{IF{REF Dropdown1} = "Strawberry" "Red"}
etc, where 'Dropdown1' is you formfield's bookmark name. The fields can all be on one line - I've put each on its own line for
clarity.

Note: The field brace pairs (ie '{ }') for the above examples are created via Ctrl-F9 - you can't simply type them or copy & paste
them from this message.

--
Cheers
macropod
[Microsoft MVP - Word]


Francis Ang said:
I have a dropdown and textbox fields in my document. When an item is
selected from the dropdown field, textbox get filled in automatically. eg. if
item 'apple' is selected, the textbox will be populated with 'green' and if
item 'strawberry' is selected, the textbox is pouplated with 'red', etc. Can
this be achieved without using VBA?

Any help is very much appreciated.

Thank you.
 
G

Graham Mayor

Did you use CTRL+F9 for each pair of brackets?

Is the dropdown field named Dropdown1 or something else? If something else,
change the REF fields to reflect the correct name.

Is the condition spelled exactly the same as in the dropdown? The condition
is case sensitive

You could use {IF{REF Dropdown1 \*Upper} = "APPLE" "Green"} etc to eliminate
the case sensitivity.

Did you actually tab out of the dropdown field to force the update?

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>


Francis said:
Hi,

Thank you very much for the quick response. I followed your advice
and did the following -

Press Ctrl+F9 to get the {}
Put in the formula between the {}
The Dropdown field is set to 'calculate on exit'
Proctect the document.

When I select the item in the dropdown list, nothing happen! Did I do
something wrong?


macropod said:
Hi Francis,

Yes, you can do this without vba.

With your dropdown formfield, make sure it:
1. has a bookmark name; and
2. is set to 'calculate on exit'.
You do this via the formfield properties.

Then, where you want the response to appear, insert a series of
formula fields coded as: {IF{REF Dropdown1} = "Apple" "Green"}
{IF{REF Dropdown1} = "Strawberry" "Red"}
etc, where 'Dropdown1' is you formfield's bookmark name. The fields
can all be on one line - I've put each on its own line for clarity.

Note: The field brace pairs (ie '{ }') for the above examples are
created via Ctrl-F9 - you can't simply type them or copy & paste
them from this message.

--
Cheers
macropod
[Microsoft MVP - Word]


Francis Ang said:
I have a dropdown and textbox fields in my document. When an item
is selected from the dropdown field, textbox get filled in
automatically. eg. if item 'apple' is selected, the textbox will be
populated with 'green' and if item 'strawberry' is selected, the
textbox is pouplated with 'red', etc. Can this be achieved without
using VBA?

Any help is very much appreciated.

Thank you.
 
P

Peter T. Daniels

I think he wants the words "red" and "green" rather than coloring the
type.
 
G

Graham Mayor

In that case change the result texts and don't bother colouring the fields.
The principle remains the same.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
F

Francis Ang

Hi,

I did all the you have mentioned. However, I did notice that when I proctect
the document, the curly brackets disappear. I must have done something wrong
but I can't figure it out.


Graham Mayor said:
Did you use CTRL+F9 for each pair of brackets?

Is the dropdown field named Dropdown1 or something else? If something else,
change the REF fields to reflect the correct name.

Is the condition spelled exactly the same as in the dropdown? The condition
is case sensitive

You could use {IF{REF Dropdown1 \*Upper} = "APPLE" "Green"} etc to eliminate
the case sensitivity.

Did you actually tab out of the dropdown field to force the update?

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>


Francis said:
Hi,

Thank you very much for the quick response. I followed your advice
and did the following -

Press Ctrl+F9 to get the {}
Put in the formula between the {}
The Dropdown field is set to 'calculate on exit'
Proctect the document.

When I select the item in the dropdown list, nothing happen! Did I do
something wrong?


macropod said:
Hi Francis,

Yes, you can do this without vba.

With your dropdown formfield, make sure it:
1. has a bookmark name; and
2. is set to 'calculate on exit'.
You do this via the formfield properties.

Then, where you want the response to appear, insert a series of
formula fields coded as: {IF{REF Dropdown1} = "Apple" "Green"}
{IF{REF Dropdown1} = "Strawberry" "Red"}
etc, where 'Dropdown1' is you formfield's bookmark name. The fields
can all be on one line - I've put each on its own line for clarity.

Note: The field brace pairs (ie '{ }') for the above examples are
created via Ctrl-F9 - you can't simply type them or copy & paste
them from this message.

--
Cheers
macropod
[Microsoft MVP - Word]


message I have a dropdown and textbox fields in my document. When an item
is selected from the dropdown field, textbox get filled in
automatically. eg. if item 'apple' is selected, the textbox will be
populated with 'green' and if item 'strawberry' is selected, the
textbox is pouplated with 'red', etc. Can this be achieved without
using VBA?

Any help is very much appreciated.

Thank you.
 
M

macropod

Hi Francis,

The braces *should* disappear, leaving you with the results of the IF test showing. If the default Dropdown option has not been
coded for, nothing will show.

--
Cheers
macropod
[Microsoft MVP - Word]


Francis Ang said:
Hi,

I did all the you have mentioned. However, I did notice that when I proctect
the document, the curly brackets disappear. I must have done something wrong
but I can't figure it out.


Graham Mayor said:
Did you use CTRL+F9 for each pair of brackets?

Is the dropdown field named Dropdown1 or something else? If something else,
change the REF fields to reflect the correct name.

Is the condition spelled exactly the same as in the dropdown? The condition
is case sensitive

You could use {IF{REF Dropdown1 \*Upper} = "APPLE" "Green"} etc to eliminate
the case sensitivity.

Did you actually tab out of the dropdown field to force the update?

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>


Francis said:
Hi,

Thank you very much for the quick response. I followed your advice
and did the following -

Press Ctrl+F9 to get the {}
Put in the formula between the {}
The Dropdown field is set to 'calculate on exit'
Proctect the document.

When I select the item in the dropdown list, nothing happen! Did I do
something wrong?


:

Hi Francis,

Yes, you can do this without vba.

With your dropdown formfield, make sure it:
1. has a bookmark name; and
2. is set to 'calculate on exit'.
You do this via the formfield properties.

Then, where you want the response to appear, insert a series of
formula fields coded as: {IF{REF Dropdown1} = "Apple" "Green"}
{IF{REF Dropdown1} = "Strawberry" "Red"}
etc, where 'Dropdown1' is you formfield's bookmark name. The fields
can all be on one line - I've put each on its own line for clarity.

Note: The field brace pairs (ie '{ }') for the above examples are
created via Ctrl-F9 - you can't simply type them or copy & paste
them from this message.

--
Cheers
macropod
[Microsoft MVP - Word]


message I have a dropdown and textbox fields in my document. When an item
is selected from the dropdown field, textbox get filled in
automatically. eg. if item 'apple' is selected, the textbox will be
populated with 'green' and if item 'strawberry' is selected, the
textbox is pouplated with 'red', etc. Can this be achieved without
using VBA?

Any help is very much appreciated.

Thank you.
 
F

Francis Ang

Hi,

I am new at this. What do you mean the dropdown option has to be coded?
The {} were created using Ctrl+F9.
The dropdown option 'calculate on exit' has been set.
Dropdown option is Bookmarked as Dropdown1

What else do I have to do?


macropod said:
Hi Francis,

The braces *should* disappear, leaving you with the results of the IF test showing. If the default Dropdown option has not been
coded for, nothing will show.

--
Cheers
macropod
[Microsoft MVP - Word]


Francis Ang said:
Hi,

I did all the you have mentioned. However, I did notice that when I proctect
the document, the curly brackets disappear. I must have done something wrong
but I can't figure it out.


Graham Mayor said:
Did you use CTRL+F9 for each pair of brackets?

Is the dropdown field named Dropdown1 or something else? If something else,
change the REF fields to reflect the correct name.

Is the condition spelled exactly the same as in the dropdown? The condition
is case sensitive

You could use {IF{REF Dropdown1 \*Upper} = "APPLE" "Green"} etc to eliminate
the case sensitivity.

Did you actually tab out of the dropdown field to force the update?

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>


Francis Ang wrote:
Hi,

Thank you very much for the quick response. I followed your advice
and did the following -

Press Ctrl+F9 to get the {}
Put in the formula between the {}
The Dropdown field is set to 'calculate on exit'
Proctect the document.

When I select the item in the dropdown list, nothing happen! Did I do
something wrong?


:

Hi Francis,

Yes, you can do this without vba.

With your dropdown formfield, make sure it:
1. has a bookmark name; and
2. is set to 'calculate on exit'.
You do this via the formfield properties.

Then, where you want the response to appear, insert a series of
formula fields coded as: {IF{REF Dropdown1} = "Apple" "Green"}
{IF{REF Dropdown1} = "Strawberry" "Red"}
etc, where 'Dropdown1' is you formfield's bookmark name. The fields
can all be on one line - I've put each on its own line for clarity.

Note: The field brace pairs (ie '{ }') for the above examples are
created via Ctrl-F9 - you can't simply type them or copy & paste
them from this message.

--
Cheers
macropod
[Microsoft MVP - Word]


message I have a dropdown and textbox fields in my document. When an item
is selected from the dropdown field, textbox get filled in
automatically. eg. if item 'apple' is selected, the textbox will be
populated with 'green' and if item 'strawberry' is selected, the
textbox is pouplated with 'red', etc. Can this be achieved without
using VBA?

Any help is very much appreciated.

Thank you.
 
M

macropod

Hi Francis,

OK, so provided the Dropdown has the Apple" and "Strawberry" options, all you need to do is to protect the document for forms and
select one of those options from the Dropdown.

--
Cheers
macropod
[Microsoft MVP - Word]


Francis Ang said:
Hi,

I am new at this. What do you mean the dropdown option has to be coded?
The {} were created using Ctrl+F9.
The dropdown option 'calculate on exit' has been set.
Dropdown option is Bookmarked as Dropdown1

What else do I have to do?


macropod said:
Hi Francis,

The braces *should* disappear, leaving you with the results of the IF test showing. If the default Dropdown option has not been
coded for, nothing will show.

--
Cheers
macropod
[Microsoft MVP - Word]


Francis Ang said:
Hi,

I did all the you have mentioned. However, I did notice that when I proctect
the document, the curly brackets disappear. I must have done something wrong
but I can't figure it out.


:

Did you use CTRL+F9 for each pair of brackets?

Is the dropdown field named Dropdown1 or something else? If something else,
change the REF fields to reflect the correct name.

Is the condition spelled exactly the same as in the dropdown? The condition
is case sensitive

You could use {IF{REF Dropdown1 \*Upper} = "APPLE" "Green"} etc to eliminate
the case sensitivity.

Did you actually tab out of the dropdown field to force the update?

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>


Francis Ang wrote:
Hi,

Thank you very much for the quick response. I followed your advice
and did the following -

Press Ctrl+F9 to get the {}
Put in the formula between the {}
The Dropdown field is set to 'calculate on exit'
Proctect the document.

When I select the item in the dropdown list, nothing happen! Did I do
something wrong?


:

Hi Francis,

Yes, you can do this without vba.

With your dropdown formfield, make sure it:
1. has a bookmark name; and
2. is set to 'calculate on exit'.
You do this via the formfield properties.

Then, where you want the response to appear, insert a series of
formula fields coded as: {IF{REF Dropdown1} = "Apple" "Green"}
{IF{REF Dropdown1} = "Strawberry" "Red"}
etc, where 'Dropdown1' is you formfield's bookmark name. The fields
can all be on one line - I've put each on its own line for clarity.

Note: The field brace pairs (ie '{ }') for the above examples are
created via Ctrl-F9 - you can't simply type them or copy & paste
them from this message.

--
Cheers
macropod
[Microsoft MVP - Word]


message I have a dropdown and textbox fields in my document. When an item
is selected from the dropdown field, textbox get filled in
automatically. eg. if item 'apple' is selected, the textbox will be
populated with 'green' and if item 'strawberry' is selected, the
textbox is pouplated with 'red', etc. Can this be achieved without
using VBA?

Any help is very much appreciated.

Thank you.
 
G

Graham Mayor

Then TAB out of the dropdown field to activate the update.
Note that this will not work if the conditional field is in the page
header/footer. For that you would need a macro to update the field.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

Hi Francis,

OK, so provided the Dropdown has the Apple" and "Strawberry" options,
all you need to do is to protect the document for forms and select
one of those options from the Dropdown.

Francis Ang said:
Hi,

I am new at this. What do you mean the dropdown option has to be
coded? The {} were created using Ctrl+F9.
The dropdown option 'calculate on exit' has been set.
Dropdown option is Bookmarked as Dropdown1

What else do I have to do?


macropod said:
Hi Francis,

The braces *should* disappear, leaving you with the results of the
IF test showing. If the default Dropdown option has not been coded
for, nothing will show. --
Cheers
macropod
[Microsoft MVP - Word]


message Hi,

I did all the you have mentioned. However, I did notice that when
I proctect the document, the curly brackets disappear. I must
have done something wrong but I can't figure it out.


:

Did you use CTRL+F9 for each pair of brackets?

Is the dropdown field named Dropdown1 or something else? If
something else, change the REF fields to reflect the correct name.

Is the condition spelled exactly the same as in the dropdown? The
condition is case sensitive

You could use {IF{REF Dropdown1 \*Upper} = "APPLE" "Green"} etc
to eliminate the case sensitivity.

Did you actually tab out of the dropdown field to force the
update? --
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>


Francis Ang wrote:
Hi,

Thank you very much for the quick response. I followed your
advice and did the following -

Press Ctrl+F9 to get the {}
Put in the formula between the {}
The Dropdown field is set to 'calculate on exit'
Proctect the document.

When I select the item in the dropdown list, nothing happen! Did
I do something wrong?


:

Hi Francis,

Yes, you can do this without vba.

With your dropdown formfield, make sure it:
1. has a bookmark name; and
2. is set to 'calculate on exit'.
You do this via the formfield properties.

Then, where you want the response to appear, insert a series of
formula fields coded as: {IF{REF Dropdown1} = "Apple" "Green"}
{IF{REF Dropdown1} = "Strawberry" "Red"}
etc, where 'Dropdown1' is you formfield's bookmark name. The
fields can all be on one line - I've put each on its own line
for clarity. Note: The field brace pairs (ie '{ }') for the above
examples
are created via Ctrl-F9 - you can't simply type them or copy &
paste them from this message.

--
Cheers
macropod
[Microsoft MVP - Word]


message
I have a dropdown and textbox fields in my document. When an
item is selected from the dropdown field, textbox get filled in
automatically. eg. if item 'apple' is selected, the textbox
will be populated with 'green' and if item 'strawberry' is
selected, the textbox is pouplated with 'red', etc. Can this
be achieved without using VBA?

Any help is very much appreciated.

Thank you.
 
F

Francis Ang

Thanks to Macropod, Graham and Peter for all your assistance.

Graham Mayor said:
Then TAB out of the dropdown field to activate the update.
Note that this will not work if the conditional field is in the page
header/footer. For that you would need a macro to update the field.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

Hi Francis,

OK, so provided the Dropdown has the Apple" and "Strawberry" options,
all you need to do is to protect the document for forms and select
one of those options from the Dropdown.

Francis Ang said:
Hi,

I am new at this. What do you mean the dropdown option has to be
coded? The {} were created using Ctrl+F9.
The dropdown option 'calculate on exit' has been set.
Dropdown option is Bookmarked as Dropdown1

What else do I have to do?


:

Hi Francis,

The braces *should* disappear, leaving you with the results of the
IF test showing. If the default Dropdown option has not been coded
for, nothing will show. --
Cheers
macropod
[Microsoft MVP - Word]


message Hi,

I did all the you have mentioned. However, I did notice that when
I proctect the document, the curly brackets disappear. I must
have done something wrong but I can't figure it out.


:

Did you use CTRL+F9 for each pair of brackets?

Is the dropdown field named Dropdown1 or something else? If
something else, change the REF fields to reflect the correct name.

Is the condition spelled exactly the same as in the dropdown? The
condition is case sensitive

You could use {IF{REF Dropdown1 \*Upper} = "APPLE" "Green"} etc
to eliminate the case sensitivity.

Did you actually tab out of the dropdown field to force the
update? --
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>


Francis Ang wrote:
Hi,

Thank you very much for the quick response. I followed your
advice and did the following -

Press Ctrl+F9 to get the {}
Put in the formula between the {}
The Dropdown field is set to 'calculate on exit'
Proctect the document.

When I select the item in the dropdown list, nothing happen! Did
I do something wrong?


:

Hi Francis,

Yes, you can do this without vba.

With your dropdown formfield, make sure it:
1. has a bookmark name; and
2. is set to 'calculate on exit'.
You do this via the formfield properties.

Then, where you want the response to appear, insert a series of
formula fields coded as: {IF{REF Dropdown1} = "Apple" "Green"}
{IF{REF Dropdown1} = "Strawberry" "Red"}
etc, where 'Dropdown1' is you formfield's bookmark name. The
fields can all be on one line - I've put each on its own line
for clarity. Note: The field brace pairs (ie '{ }') for the above
examples
are created via Ctrl-F9 - you can't simply type them or copy &
paste them from this message.

--
Cheers
macropod
[Microsoft MVP - Word]


message
I have a dropdown and textbox fields in my document. When an
item is selected from the dropdown field, textbox get filled in
automatically. eg. if item 'apple' is selected, the textbox
will be populated with 'green' and if item 'strawberry' is
selected, the textbox is pouplated with 'red', etc. Can this
be achieved without using VBA?

Any help is very much appreciated.

Thank you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top