Totes Posted April 5, 2007 Posted April 5, 2007 Hello, Well I’m stuck again. I am still working on my “Victim” database here at work and have a question about photos. I have an area with a container for the victim’s photo. What I want to do is have the container that is not used for a victim’s photo default to a “No Photo” image in the container. I have the “No Photo” JPEG constructed, but I do not know how to make the Photo Container default to this image. Hopefully to clarify: when a new victim record is created, the photo container automatically shows my “No Photo” JPEG until the user adds a photo of the victim to that container. Can this be done? Thanks, James
mr_vodka Posted April 5, 2007 Posted April 5, 2007 (edited) Sure. Have a global container field with the default image in it. gDefaultPic. Method 1. In your container field where you store the photo have an auto entry lookup referencing gDefaultPic. Each time a new record is created it will bring in that picture. However this method is not really optimal because you have stored a lot of copies of the same image. Method 2. Create a calculation field with container result of Case ( PhotoField; PhotoField; gDefaultPic ) Then you would have to overlay the calc field on top of the photo container field. For the calc field, change the behavior of the field so that it can not be entered. Method 3 There can be yet another way in which you can store the default image in a one record preferences table instead of a global field and have the calc field be Case ( not PhotoField; 1 ). Create a relationship from this calc field to a field in the preference table with just the auto-enter value 1. Now whenever the PhotoField is empty it will return 1 and hence the relationship being valid so it will display the related image. You would still overlay the field on top of the other but you would use the related preferences field instead. Edited April 5, 2007 by Guest Added yet another
Totes Posted April 5, 2007 Author Posted April 5, 2007 Thanks again. Method 2 looks like the choice. Ill put into operation tonight when I get home. James
Totes Posted April 6, 2007 Author Posted April 6, 2007 Mr. V, Well I have method 2 in place and working well...however I just do not understand it. Could you take a moment and explain. How can you have an image over an image and then have one or the other displayed. Thanks again, J
mr_vodka Posted April 8, 2007 Posted April 8, 2007 It'r rather simple. The first field is the container field where you would put the person's picture into. The other one is a calc field that displays the generic image if the picture container field is empty. So it will display the default picture until you enter an image into the container field. Once the container field has something in it, the calc field will not display the default image and thus to the user will display one or the other.
Recommended Posts
This topic is 6440 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now