Yes/No Formatting for Text Box on a Report

B

bmdumr

I'm trying to set up the format in a text box on a report. If I put i
a text box with data [bob] which is a yes/no data type, I can give i
the custom formatting I wish in the format property as: ;"WAS";"WA
NOT"

Now how do I go about formatting a text box control where I want t
include some other text (using the format$() command)? Here was m
idea, which does not work:

Textbox data:
="Preceeding text " & Format$([bob],";was;was not") & " ending text"

This gives me an error and so does double quoting the 'was' and 'wa
not'. In fact when I use the above, it changes it t
Format$([bob],";w\as;w\asn""ot"""). What gives?

Any ideas? I know this has to be possible, I just can't get i
though.

Thanks,
Brad
[email protected]
 
M

Marshall Barton

bmdumr said:
I'm trying to set up the format in a text box on a report. If I put in
a text box with data [bob] which is a yes/no data type, I can give it
the custom formatting I wish in the format property as: ;"WAS";"WAS
NOT"

Now how do I go about formatting a text box control where I want to
include some other text (using the format$() command)? Here was my
idea, which does not work:

Textbox data:
="Preceeding text " & Format$([bob],";was;was not") & " ending text"

This gives me an error and so does double quoting the 'was' and 'was
not'. In fact when I use the above, it changes it to
Format$([bob],";w\as;w\asn""ot"""). What gives?


You need to double up on the quotes within quotes.

="Preceeding text " & Format$([bob],";""was"";""was not""")
& " ending text"

Alternatively, format strings allow the use of \ to "quote"
a single character.

="Preceeding text " & Format$([bob],";\w\a\s;\w\a\s \n\o\t")
& " ending text"

The reason for all this glop is that most characters specify
how to format the value, e.g. n is minutes, s is seconds,
etc.
 
F

Fons Ponsioen

Hi.
I did not see how you are actually storing the variable
which would indicate the respective selection.
if you store like from a option button maybe the following
helps.
if the values are consecutive, low numeric values (ie
1,2,3,..)as from an option button, then
consider using the Choose() function
=Choose([FieldValue],"Hardware", "Software", "Other")
or:
=IIF (OptionValue = 1,"Hardware",IIF(OptionValue =
2,"Software","Other"))
Hope this helps.
Fons
 
Top