displaying a picture from a text field in MS Access 2002

O

Octavee Uhl

Hi,

I have a question about displaying a picture in MS Access 2002.

I use a field called: PicturePathAndFile which is a text field. Now I have a
unbound field in a form which should display the picture when open.

I want to have a function that displays the picture when there is
information in the field PicturePathAndFile and to do nothing when there is
no entry in PicturePathAndFile. And it should automatically update the
information when I go to the next record.



Thanks so much

Octavee
 
O

Octavee Uhl

Thanks Arvin,

one more thing. When I go to the next record and there is no data in the
field: PicturePathAndFile it gives me an error. How can I display nothing
without error?

Thanks again
Octavee
 
M

Mark

Octavee,
Try something like this:

If Not IsNull(Me.PicturePathAndFile) Then
Me.ImageControl.Picture = Me.PicturePathAndFile
End If
 
A

Arvin Meyer

What I do is to prepare a file of an image with "No Picture Available"
FileExists code to determine which image to display:

Here's the FileExists code I use:

Public Function FileExists(strFileSpec As String) As Boolean

Dim intFileLength As Integer

On Error Resume Next

intFileLength = FileLen(strFileSpec)

If Err = 53 Then
FileExists = False
Else
FileExists = True
End If

End Function
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access Downloads
http://www.datastrat.com
http://www.mvps.org/access
 

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