rvp032582
Posts: 47
|
| Posted: 03/26/2006, 6:59 PM |
|
hi. i need to be able to have a peice of a grid hidden, if there are nothing in that field.
for example a table is title, photo, caption, name. the user enters in data for all fields EXCEPT a photo. on the page this grid component is on, that data will appear and a broken image will appear (the box with red x).
does anyone know the code that would say that if there is no photo then to hide that portion of the grid only? i have tried:
If Properties1.PropPhoto.value Then
Properties1.PropPhoto.visible = FALSE
End If
that one didn't work. any suggestions are appreciated, thanks.
|
 |
 |
mhope
Posts: 37
|
| Posted: 03/26/2006, 9:19 PM |
|
For an image I use 2 labels one just before the image data field and one just after and use an If condition as follows:
If users.MainImage.Value = "" Then
users.MainImgShow.Value = "No photo"
users.MainImgShowEnd.Value = ""
Else
users.MainImgShow.Value = "<img src=""memPic/"
users.MainImgShowEnd.Value = """ height=""75"">"
End If
I place the MainImgShow just before the image data field and the MainImgShowEnd so if there is a value in the image data field the labels turn into an image tab else the first lable simply says “No Image”
Hope this helps
|
 |
 |
mhope
Posts: 37
|
| Posted: 03/26/2006, 9:20 PM |
|
Oh and the image data field should be a label too
|
 |
 |
zolw
Posts: 51
|
| Posted: 03/27/2006, 8:42 AM |
|
Why don´t you try this?
Don´t add the image as an image, but as a label (you can change the type using right click on the image and chhosing "Cange To - Label)".
Then change the "Content" property in the label to HTML instead of text.
Then on "Before Show" for that label you add something like this.
Assuming the grid is called "pictures" and the label is called "photo" and the path to the image files is "images/".
If pictures.photo.value <> "" Then
picture.photo.value = "<img src=""images/" & pictures.photo.value & """>"
Else
picture.photo.value = "No picture"
End IF
_________________
Zolw
http://www.xlso.com |
 |
 |
marcwolf
Posts: 361
|
| Posted: 03/27/2006, 2:39 PM |
|
I used zolw's suggestion many times for images and links.
Sometimes its best when you have either a complex link or a image that you want to manipulate the visibility on.
The HTML properties of the label can be extremely useful as it can let you fine tune your applications visibility.
Take Care
Dave
_________________
' Coding Coding Coding
Keep Those Keyboards Coding.
Raw Code!!!!!!!
|
 |
 |