Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Making a pictures apear (or not) with if els statements

Status
Not open for further replies.

Maxhell

IS-IT--Management
Oct 13, 2003
5
US
Hello. I am trying to make Employee badges at work using Crystal Reports 8.0. Basically, all employees have a four digit number assigned to them. I can call up the four digit number and display it but what I want to do is have that number reference a picture on the form (which all start out invisible or "suppressed") and make it appear. So I have all the different employee's pictures on the form but I do not know how to:
A) Differentiate between them. I.E. give each one a different name or label so I can refrence then in an algorithm.

B) Make an if/then statement that reads if the employee number is x, make picture x appear, else make it disappear.

So the code lay out is something like:

if ( empbasic.empphoto = 3204) then
{
3204.supressed = false;
}
else
{
3204.supressed = true;
}

*Note: empbasic is the database where the employee info is coming from, and empphoto is the field which displays/contains the employee number.

Am I on the right track? How do I label my pictures or get this to work?!?

THANK YOU!

Max
 
If you already have all of the pictures on the form, you can use the x+2 function beside "suppress" and enter a formula for the picture such as:

not({empbasic.emphoto}) = "3204"

The only problem is that you would have to do this for each picture which could be time consuming depending on the number of employees.
 
Cool! Thanx! Let me try that. I figured I would have to type it in for all the pictures...but its copy and paste so I don't mind. I'll let you know if I get it working. Thanks again.
 
Ok, it seems like I am closer now...but I get an error that says "A boolean is required here" and it points to the "not(" What does that mean and how do I set it as a boolean. Is it asking if that case is true or false? Im comfused again! haha
 
Slight mistake--the paren is in the wrong place. Should be:

not({empbasic.emphoto} = "3204")

Or better yet:

{empbasic.emphoto} <> &quot;3204&quot;

-LB

 
THANK YOU! I got it working! Now i just have to put that code in everyone's picture. I will update you guys if it works. THANK YOU SO MUCH!

 
Thanks, LB for catching the ) - been typing so much today, I'm seeing those things in my sleep.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top