Image

J

Jason Frazer

I have an image with the name "Image" in a form. When there is no data in
the field [PictureName] i don't want the image visible.
The "Image.Visible = no" code works great.
When i added this code "Image.Visible = yes" to make the image visable when
there is data in the [PictureName] field the image disappears.
What am i doing wrong.
I have included the code below.

Thanks for you help
Jason Frazer

Private Sub Form_Current()
Dim sImagePath As String
Dim Mycheck As Variant
Mycheck = IsNull(Me.PictureName)
If Mycheck = True Then
Image.Visible = no
Exit Sub
End If
Image.Visible = yes
sImagePath = CurrentProject.Path & "\Images\" & Me.PictureName & ".jpg"
'sImagePath = Me.PictureName
Image.Picture = sImagePath
Me.Refresh
End Sub
 
C

Chris

Without too much looking, have you tried replacing Yes and
No with True and False?


Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top