Show Hide mergefield

B

Bill

Hi,

Thought to use an if statement to hide or show a merged filed and add text.

{If {MERFEFIELD "ResellersDiscount"}<>0 "The above prices are subject to a
resellers discount of {MERGEFIELD "ResellersDiscount"} % If payment is
Recieved on Due date" " "}

The merged field comes from an access form via the code from "Albert D.
Kallal (Access MVP)".

On the form the user can select various discounts from 0 to 30%.
So I wanted a Field that said if the value is not 0 then add the word and
the merge field and if it is zero suppress the merge field.
Problem is even the merge doesn't work and the result will not be what I
want anyway if the field value is 0 (zero).

can I use code?
If so what is the way?
or
Can it been done with switches and mergefields?
If so please show me the way.
Thanks in advance
Bill
 
D

Doug Robbins - Word MVP

It is much better to to the data manipulation in the database. Use a query
that includes a field with the necessary text.

--
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
 
B

Bill

Hi Doug,
Sort of understand where your coming from.
I can add the text if the user selects anything greater than 0% and populate
a feild on the Form wich will be in the merge.

Say that 0% is sellected and this gets passed in the merge. Can I hide the
merge field?
Best Regards
Bill
 
G

Graham Mayor

Form? What sort of form?

What is the actual result of selecting 0% in the form?

How is that related to the 0 in the conditional field?

What does the ResellersDiscount field *actually* contain when you think it
should be 0? Insert the MergeField in a test document and merge the data.
Adjust the test condition accordingly.

Add a space either side of <>.

I take it 'MERFEFIELD' is a typo? Use the macro at
http://www.gmayor.com/export_field.htm to export fields to text accurately.


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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
M

macropod

Hi Bill,

This could be easier than you might think. If the variable is only "The above prices are subject to a resellers discount of #%",
simply edit your mergefield to read:
{MERFEFIELD "ResellersDiscount"\# "The above prices are subject to a resellers discount of #%;;"}
If you also need to include the string "if payment is received on the due date.", simply add another mergefield that reads:
{MERFEFIELD "ResellersDiscount"\# " if payment is received on the due date.;;"}
 
G

Graham Mayor

Is MERFEFIELD contagious? ;)

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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
B

Bill

Thanyou all.

Graham:
The form is an access form, the information is merged to a word doc.
The result of selecting zero is to give the user a result if they select
that feild as one of the options contained in a combolist.
The feild is called ResellersDiscount on the access form and merges to the
word document field called ResellersDiscount.
When the feild contains "0" (zero) the feild should not be shown along with
the text,
Reason for this is not to give the customer the idea that discount can be
sort. And if the customer is a reseller then the value which will be greater
than "0" is shown along with the text - mickey mouse way I suppose.

Thanks for picking the typo could explain why Word rebelled and spat the
dumby over it - " Error! Unkown op code for conditional" - looked at that for
ages with out seeing it.

Macropod
Cheers.

To all
Thanks again
I will adapt.

Best regards
Bill

macropod said:
Apparently. Oh, the perils of copy & paste!

--
Cheers
macropod
[MVP - Microsoft Word]


Graham Mayor said:
Is MERFEFIELD contagious? ;)

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

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
B

Bill

Update.

I have use the suggestion of concatenating from the access form. Creating 3
strings one of which is the field and calling it str4. Str4 populates a new
field called Resellertxt which is merged in the word document.
Any selected value above 0 in the combobox called ResellersDiscount gives
the required text. If the value is 0 then the cocatenated string in the new
filed Resellertxt is empty and the merge field in the word doc has no value
and hense is not visible and suppresed.
Cheers all
Best regards
Bill

Bill said:
Thanyou all.

Graham:
The form is an access form, the information is merged to a word doc.
The result of selecting zero is to give the user a result if they select
that feild as one of the options contained in a combolist.
The feild is called ResellersDiscount on the access form and merges to the
word document field called ResellersDiscount.
When the feild contains "0" (zero) the feild should not be shown along with
the text,
Reason for this is not to give the customer the idea that discount can be
sort. And if the customer is a reseller then the value which will be greater
than "0" is shown along with the text - mickey mouse way I suppose.

Thanks for picking the typo could explain why Word rebelled and spat the
dumby over it - " Error! Unkown op code for conditional" - looked at that for
ages with out seeing it.

Macropod
Cheers.

To all
Thanks again
I will adapt.

Best regards
Bill

macropod said:
Apparently. Oh, the perils of copy & paste!

--
Cheers
macropod
[MVP - Microsoft Word]


Graham Mayor said:
Is MERFEFIELD contagious? ;)

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

My web site www.gmayor.com

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


macropod wrote:
Hi Bill,

This could be easier than you might think. If the variable is only
"The above prices are subject to a resellers discount of #%", simply
edit your mergefield to read: {MERFEFIELD "ResellersDiscount"\# "The
above prices are subject to a resellers discount of #%;;"} If you also
need to include the string "if payment is received on the
due date.", simply add another mergefield that reads: {MERFEFIELD
"ResellersDiscount"\# " if payment is received on the due date.;;"}

Hi,

Thought to use an if statement to hide or show a merged filed and
add text. {If {MERFEFIELD "ResellersDiscount"}<>0 "The above prices are
subject to a resellers discount of {MERGEFIELD "ResellersDiscount"}
% If payment is Recieved on Due date" " "}

The merged field comes from an access form via the code from "Albert
D. Kallal (Access MVP)".

On the form the user can select various discounts from 0 to 30%.
So I wanted a Field that said if the value is not 0 then add the
word and the merge field and if it is zero suppress the merge field.
Problem is even the merge doesn't work and the result will not be
what I want anyway if the field value is 0 (zero).

can I use code?
If so what is the way?
or
Can it been done with switches and mergefields?
If so please show me the way.
Thanks in advance
Bill
 

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