Show new pictures in image control

  • Thread starter Jean Van Harlingen
  • Start date
J

Jean Van Harlingen

I am trying to set up a form that will display pictures in an image control
based on the contents of a text box control that contains the path to the
external image file. In design view I am able to access the external image
file, but when I try to change the picture property of the image control via
VBA I get an error message which says that access can't open the external
file.

This is the code I am using:

Dim Pf As String
If Not IsNull(Me.PictureFile) Then
Pf = (Me.PictureFile)
Me!ActualImage.Picture = Pf
Else
Me!ActualImage.Picture = ""
End If

Any ideas???
 
B

bob

I just tried your exact code (in the Form_Current event) using the same path and filename and it worked
for me. I can only suggest making absolutely sure that the path is correct, and try opening the image
in a graphics app to verify the image is ok (try copying the path from the table then pasting it in the
app's file-open dialog).



--
_______________________________________________________
DBPix 2.0: Add pictures to Access, Easily & Efficiently
http://www.ammara.com/dbpix/access.html
 
J

Jean Van Harlingen

Ahhh there was a space in the filename I didn't see - works great now.
Thanks for the help!
 

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