how to add pictures in a form

G

Guest

Hi:

I am trying to add pictures to an existing form, I started by adding an OLE
field in my table and modifying my query to do the form. I have tried most of
the previous suggestions on the forum but I still cannot get the picture to
automatically display on the form when I am navigating through different
records.
I got the form to display the name of the picture and it shows it only if I
double click it. I tried to fix this by going to the control box in design
view and modify the property " Auto Activate" there are 3 option for
autoactivate, I select "get focus" but all I get is a message saying "The OLE
object can't be activated upon receiving the focus" Is this the reason I
can't get the picture to display in the form?


HELP PLEASE!!
 
G

Guest

Daniel,
Thanks for the response. I had already tried to do what I found in the link
you post. I specifically tried the following:


1. Use the AutoForm: Columnar Wizard to create a new form that is based on
the ImageTable table.
2. Open the Imageform form in Design view and then add an image control to
the form by using the Image tool in the toolbox. You are prompted to select
an image to insert. Select any image available on your computer. Name the
control ImageFrame.
3. Set the OnCurrent property of the Imageform form to the following event
procedure: Private Sub Form_Current()
On Error Resume Next
Me![ImageFrame].Picture = Me![ImagePath]
End Sub


4. Set the AfterUpdate property of the ImagePath text box to the following
event procedure: Private Sub ImagePath_AfterUpdate()
On Error Resume Next
Me![ImageFrame].Picture = Me![ImagePath]
End Sub


But I didn't get the picture to change accordingly, in other words I get the
same picture that I uploaded in step 2 for all the records.
I don't know what Im doing wrong.
 
G

Guest

Sara said:
Daniel,
Thanks for the response. I had already tried to do what I found in the link
you post. I specifically tried the following:


1. Use the AutoForm: Columnar Wizard to create a new form that is based on
the ImageTable table.


make sure the Image Type is Linked rather than embedded
and set the Size mode in set to Zoom

2. Open the Imageform form in Design view and then add an image control to
the form by using the Image tool in the toolbox. You are prompted to select
an image to insert. Select any image available on your computer. Name the
control ImageFrame.
3. Set the OnCurrent property of the Imageform form to the following event
procedure: Private Sub Form_Current()
On Error Resume Next
Me![ImageFrame].Picture = Me![ImagePath]
End Sub


4. Set the AfterUpdate property of the ImagePath text box to the following
event procedure: Private Sub ImagePath_AfterUpdate()
On Error Resume Next
Me![ImageFrame].Picture = Me![ImagePath]
End Sub


But I didn't get the picture to change accordingly, in other words I get the
same picture that I uploaded in step 2 for all the records.
I don't know what Im doing wrong.


your real problem is that you reference the control improperly (wrong name).
It's not ImagePath but rather ImgPath. Change your events code to what is
below and it should work fine (it does for me).

Private Sub Form_AfterUpdate()
On Error Resume Next
Me![ImageFrame].Picture = Me.imgPath.Value
End Sub

Private Sub Form_Current()
On Error Resume Next
Me![ImageFrame].Picture = Me.imgPath.Value
End Sub

Daniel
 

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