Access Forms 2002

  • Thread starter Thread starter Maria
  • Start date Start date
M

Maria

Hello!

I am trying to create a before and after picture in a form. These pictures
will be different in each record. I tried created an OLE Object and a frame
which works, but when i tried to do it again for the after picture it does
not work. It is picking up info form the first ole object. Am I able to
create 2 ole objects in a form that will change from records to record?
 
Hello!

I am trying to create a before and after picture in a form. These pictures
will be different in each record. I tried created an OLE Object and a frame
which works, but when i tried to do it again for the after picture it does
not work. It is picking up info form the first ole object. Am I able to
create 2 ole objects in a form that will change from records to record?

Before and After what?
Don't use OLE controls.
Store both the Before and After pictures in a folder on your hard
drive (not in the Access application).

Store the picture names in 2 separate Text fields on each record, i.e.
"BeforePicture.jpg" and "AfterPicture.jpg"

Then use an Image control on your form.
Code the Form's Current event:
Me.ImageName.Picture = "C:\MyFolderName\" & [BeforePictureFieldName]

Code the Forms AfterUpdate event:
Me.ImageName.Picture = "C:\MyFolderName\" & AfterPictureFieldName]

Note: If you save the record by navigating to the next record, the
After picture will appear, then immediately change back to the next
Before picture (when the Current event fires).
If you are staying on the same record then the After picture will
display until you go to the next record.

You also might try using a Control's AfterUpdate event instead of the
Form's AfterUpdate event instead.
 
Option Compare Database

Current Event
Me.ImageName.Picture = "H:\Before\PICS2\" & [BeforePictureFieldName]

ption Compare Database

AfterUpdate Event
Me.ImageName.Picture = "H:\After\PICS3\" & [BeforePictureFieldName]
--

I clicked on the Imgae Icon and created the 2 above. But how do I get the 2
fields in my table into my form so that the picutures change with each record?
Maria


fredg said:
Hello!

I am trying to create a before and after picture in a form. These pictures
will be different in each record. I tried created an OLE Object and a frame
which works, but when i tried to do it again for the after picture it does
not work. It is picking up info form the first ole object. Am I able to
create 2 ole objects in a form that will change from records to record?

Before and After what?
Don't use OLE controls.
Store both the Before and After pictures in a folder on your hard
drive (not in the Access application).

Store the picture names in 2 separate Text fields on each record, i.e.
"BeforePicture.jpg" and "AfterPicture.jpg"

Then use an Image control on your form.
Code the Form's Current event:
Me.ImageName.Picture = "C:\MyFolderName\" & [BeforePictureFieldName]

Code the Forms AfterUpdate event:
Me.ImageName.Picture = "C:\MyFolderName\" & AfterPictureFieldName]

Note: If you save the record by navigating to the next record, the
After picture will appear, then immediately change back to the next
Before picture (when the Current event fires).
If you are staying on the same record then the After picture will
display until you go to the next record.

You also might try using a Control's AfterUpdate event instead of the
Form's AfterUpdate event instead.
 
Back
Top