Error Message with Displaying Check Box in Crystal Reports - Special variable must be assigned

Hi,

This is well documented on EE and also with google, but I am getting an error I  can't quite find results. I am not sure if I need to assign a variable, becuase I am not use to formulas inside Crystal.

I've inserted into formula field:

If {table.IsHospital} = true then
Chr(254) Else
Chr (168)
End if

I get "special variable "formula" must be assigned a value within the formula

My data type is listed as (udtlogical(bit),null)

I have choose Visual Basic, not crystal syntax in the formula field.

Thanks for any help
bvanscoy678Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mlmccCommented:
Since you are using Basic Syntax you  need to assign the value to be returned to the "variable" formula

 If {table.IsHospital} = true then
     formula = Chr(254)
Else
      formula = Chr (168)
End if


If you use Crystal syntax then yours will work with the end if removed

If {table.IsHospital} = true then
    Chr(254)
Else
    Chr (168)


mlmcc
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
bvanscoy678Author Commented:
Okay, I did that, but now I am getting different errors:

if {UDSTEMI_.YES_1}= True then
Formula = chr(254) else
Formula = chr(156)
End if

I get " must be a number"

if I use:

if {UDSTEMI_.YES_1}= 1 then

error is need boolean value

if I use:

if {UDSTEMI_.YES_1}= Yes then

then I get must be a number.

this makes me think I have some type of datatype that is not working.

thanks!
0
bvanscoy678Author Commented:
I think I need to declare formula as a boolean value
0
bvanscoy678Author Commented:
Thank you, I'll post the error as another thread.

Brent
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.