Form Fields - Case Statement or Something Simpler?

  • Thread starter Thread starter djhowes
  • Start date Start date
D

djhowes

I'm designing a Word form containing a table, which when Protected will
enable users to enter numbers in some fields, and which auto calculates
values in other cells.

I have one cell that contains a calculated form field that produces a
numerical value in the range 6-24 based on adding values in other cells; I
have given this field the Bookmark name of Perf.

In an adjacent cell I want the form to enter different text strings
dependent on the value of the Perf cell. How do I achieve this? I have
tried using IF expressions to no avail - regardless of the value of Perf I
always get the first text string.

To take this a stage further, I have another adjacent cell that contains a
drop down list field with various text values (Bookmarked as NCAPerf), the
first option of which is "N/A" (for not applicable). How do I modify the
answer to the first question such that if the value of NCAPerf is anything
other than "N/A" then the different text strings referred to above are
displayed, but that if "N/A" has been selected, then the cell displays an
empty text string ("")?

I am using Word 2003.
 
You would need to use a macro to accomplish what you are after, probably run
on exit from the dropdown form field. It would use a VBA If,,End if
constuction the check the item selected in the dropdown form field and then
set the .Result of a formfield in the cell adjacent to Perf to either
nothing, or some text that would be based the use of a Select Case
construction that uses the .Result of the Perf form field.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
Doug

Thanks for your reply. Whilst I understand the gist of your answer,
unfortunately I have no VBA experience and so I have no idea how to
write/construct what you describe.

Also the field in question must display from its choice of text strings
until the NCAPerf field is set to N/A, ie the choice of text other than N/A
that the user selects will be related to his assessment of the text string
statement displayed, based on the Perf value.
 
Hi djhowes,

I believe you can solve the problem with a set of nested fields coded as:
{IF{NCAPerf}<> "N/A" "{IF{Perf}= 1 "Perf = 1"}{IF{Perf}= 2 "Perf = 2"}{IF{Perf}= 3 "Perf = 3"} … {IF{Perf}= 24 "Perf = 24"}"}
where "Perf = #" represents the string for the specified Perf value and both the fields that generate the Perf bookmark and the
dropdown field that generates the NCAPerf bookmark have their properties set to 'calculate on exit. No macros required.

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

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

Back
Top