How to link pictures into the database

I

Iram

Hello.
I am using Access 2003. When I pull up a record on a form or report I would
like to view the associated picture. The pictures reside in a folder such as
C:\Pictures\. I don't want to embed them into the database rather I would
like the field called "Photo" in a form and in a report to automatically pull
a preview of a particular pic into it.
Is this possible, if so how would I make it work?


Thanks.
Iram/mcp
 
F

fredg

Hello.
I am using Access 2003. When I pull up a record on a form or report I would
like to view the associated picture. The pictures reside in a folder such as
C:\Pictures\. I don't want to embed them into the database rather I would
like the field called "Photo" in a form and in a report to automatically pull
a preview of a particular pic into it.
Is this possible, if so how would I make it work?

Thanks.
Iram/mcp

Set the [Photo] field (in the table) to Text datatype.
Then, using a form for data entry, enter the picture name, and it's
extension, in the [Photo] field, i.e. SummerFlowers.jpg.

To show the picture on a report....
Include the [Photo] field in the Report's record source.
Add an Image control to the report. You will have to set the Picture
property to a picture and save the change. Then, delete the control's
picture property. When done it should read (none). Save the change.

Code the Report Section's (i.e. Detail section) Format event

Me.ImageName.Picture = "C:\Pictures\" & [Photo]

To show the picture on a form...
Add the Image control to the form as above.
Code the Form's Current event as above.
 
I

Iram

I chugging along.
We have...
Changed the Photo field to a text field.
Added a picture name to the field i.e. 10050.jpg
Added the field to the report query.
Added the field to the report.
Added an "Image" box, and associated a pic with it (part of the wizard),
saved it, the pic was showing.
Deleted the pic from the image "Picture" setting, it changed to (None).
Picture type is "Embedded", Size Mode is "Clip", Picture alignment is
"Centered".

Right clicked in the detail section of the report and clicked "Properties",
Clicked on the "Event" tab then click on "On Format", [Event Procedure]...
and copied the below into it...

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me.ImageName.Picture = "C:\More Pics2 & [Foto]"
End Sub

However when I compile this it doesn't like the "ImageName" part. What am I
doing wrong? Can you please help?


Thanks.
Iram/mcp









fredg said:
Hello.
I am using Access 2003. When I pull up a record on a form or report I would
like to view the associated picture. The pictures reside in a folder such as
C:\Pictures\. I don't want to embed them into the database rather I would
like the field called "Photo" in a form and in a report to automatically pull
a preview of a particular pic into it.
Is this possible, if so how would I make it work?

Thanks.
Iram/mcp

Set the [Photo] field (in the table) to Text datatype.
Then, using a form for data entry, enter the picture name, and it's
extension, in the [Photo] field, i.e. SummerFlowers.jpg.

To show the picture on a report....
Include the [Photo] field in the Report's record source.
Add an Image control to the report. You will have to set the Picture
property to a picture and save the change. Then, delete the control's
picture property. When done it should read (none). Save the change.

Code the Report Section's (i.e. Detail section) Format event

Me.ImageName.Picture = "C:\Pictures\" & [Photo]

To show the picture on a form...
Add the Image control to the form as above.
Code the Form's Current event as above.
 
G

Gina Whipp

ImageName should be changed the Image Box name on your report.

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

Iram said:
I chugging along.
We have...
Changed the Photo field to a text field.
Added a picture name to the field i.e. 10050.jpg
Added the field to the report query.
Added the field to the report.
Added an "Image" box, and associated a pic with it (part of the wizard),
saved it, the pic was showing.
Deleted the pic from the image "Picture" setting, it changed to (None).
Picture type is "Embedded", Size Mode is "Clip", Picture alignment is
"Centered".

Right clicked in the detail section of the report and clicked
"Properties",
Clicked on the "Event" tab then click on "On Format", [Event Procedure]...
and copied the below into it...

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me.ImageName.Picture = "C:\More Pics2 & [Foto]"
End Sub

However when I compile this it doesn't like the "ImageName" part. What am
I
doing wrong? Can you please help?


Thanks.
Iram/mcp









fredg said:
Hello.
I am using Access 2003. When I pull up a record on a form or report I
would
like to view the associated picture. The pictures reside in a folder
such as
C:\Pictures\. I don't want to embed them into the database rather I
would
like the field called "Photo" in a form and in a report to
automatically pull
a preview of a particular pic into it.
Is this possible, if so how would I make it work?

Thanks.
Iram/mcp

Set the [Photo] field (in the table) to Text datatype.
Then, using a form for data entry, enter the picture name, and it's
extension, in the [Photo] field, i.e. SummerFlowers.jpg.

To show the picture on a report....
Include the [Photo] field in the Report's record source.
Add an Image control to the report. You will have to set the Picture
property to a picture and save the change. Then, delete the control's
picture property. When done it should read (none). Save the change.

Code the Report Section's (i.e. Detail section) Format event

Me.ImageName.Picture = "C:\Pictures\" & [Photo]

To show the picture on a form...
Add the Image control to the form as above.
Code the Form's Current event as above.
 
F

fredg

I chugging along.
We have...
Changed the Photo field to a text field.
Added a picture name to the field i.e. 10050.jpg
Added the field to the report query.
Added the field to the report.
Added an "Image" box, and associated a pic with it (part of the wizard),
saved it, the pic was showing.
Deleted the pic from the image "Picture" setting, it changed to (None).
Picture type is "Embedded", Size Mode is "Clip", Picture alignment is
"Centered".

Right clicked in the detail section of the report and clicked "Properties",
Clicked on the "Event" tab then click on "On Format", [Event Procedure]...
and copied the below into it...

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me.ImageName.Picture = "C:\More Pics2 & [Foto]"
End Sub

However when I compile this it doesn't like the "ImageName" part. What am I
doing wrong? Can you please help?

Thanks.
Iram/mcp

fredg said:
Hello.
I am using Access 2003. When I pull up a record on a form or report I would
like to view the associated picture. The pictures reside in a folder such as
C:\Pictures\. I don't want to embed them into the database rather I would
like the field called "Photo" in a form and in a report to automatically pull
a preview of a particular pic into it.
Is this possible, if so how would I make it work?

Thanks.
Iram/mcp

Set the [Photo] field (in the table) to Text datatype.
Then, using a form for data entry, enter the picture name, and it's
extension, in the [Photo] field, i.e. SummerFlowers.jpg.

To show the picture on a report....
Include the [Photo] field in the Report's record source.
Add an Image control to the report. You will have to set the Picture
property to a picture and save the change. Then, delete the control's
picture property. When done it should read (none). Save the change.

Code the Report Section's (i.e. Detail section) Format event

Me.ImageName.Picture = "C:\Pictures\" & [Photo]

To show the picture on a form...
Add the Image control to the form as above.
Code the Form's Current event as above.

Change ImageName to whatever the actual name of your Image control is
as I/we have no way of knowing what name Access assigned to the
control when you added it. On the Properties sheet of the Image
control, click on the Other Tab. The Image name is the first item.

Also this code
"C:\More Pics2 & [Foto]"
is not correct.
Change it to:
"C:\More Pics2\" & [Foto]

Note added second \ and the position of the second ".

Everything else looks OK.
 
I

Iram

Thanks Gina.
Problem. It doesn't like the word "Picture" in the code below...

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me.FotoImage.Picture = "C:\Pics & [Foto]"
End Sub


Iram


Gina Whipp said:
ImageName should be changed the Image Box name on your report.

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

Iram said:
I chugging along.
We have...
Changed the Photo field to a text field.
Added a picture name to the field i.e. 10050.jpg
Added the field to the report query.
Added the field to the report.
Added an "Image" box, and associated a pic with it (part of the wizard),
saved it, the pic was showing.
Deleted the pic from the image "Picture" setting, it changed to (None).
Picture type is "Embedded", Size Mode is "Clip", Picture alignment is
"Centered".

Right clicked in the detail section of the report and clicked
"Properties",
Clicked on the "Event" tab then click on "On Format", [Event Procedure]...
and copied the below into it...

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me.ImageName.Picture = "C:\More Pics2 & [Foto]"
End Sub

However when I compile this it doesn't like the "ImageName" part. What am
I
doing wrong? Can you please help?


Thanks.
Iram/mcp









fredg said:
On Sat, 25 Jul 2009 15:49:00 -0700, Iram wrote:

Hello.
I am using Access 2003. When I pull up a record on a form or report I
would
like to view the associated picture. The pictures reside in a folder
such as
C:\Pictures\. I don't want to embed them into the database rather I
would
like the field called "Photo" in a form and in a report to
automatically pull
a preview of a particular pic into it.
Is this possible, if so how would I make it work?

Thanks.
Iram/mcp

Set the [Photo] field (in the table) to Text datatype.
Then, using a form for data entry, enter the picture name, and it's
extension, in the [Photo] field, i.e. SummerFlowers.jpg.

To show the picture on a report....
Include the [Photo] field in the Report's record source.
Add an Image control to the report. You will have to set the Picture
property to a picture and save the change. Then, delete the control's
picture property. When done it should read (none). Save the change.

Code the Report Section's (i.e. Detail section) Format event

Me.ImageName.Picture = "C:\Pictures\" & [Photo]

To show the picture on a form...
Add the Image control to the form as above.
Code the Form's Current event as above.
 
G

Gina Whipp

Iram,

Are you using an Image control? Because Picture is what is used.

I also see something else.. What is [Foto]? If you are specifying the path
to the picture then use...

Me.FotoImage.Picture = "C:\Pics\NameOfYourPhoto.ExtensionOfYourPicure"

OR if you are storing the name of your image in a field...

Me.FotoImage.Picture = "C:\Pics\" & Me.NameOfTheField"


--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

Iram said:
Thanks Gina.
Problem. It doesn't like the word "Picture" in the code below...

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me.FotoImage.Picture = "C:\Pics & [Foto]"
End Sub


Iram


Gina Whipp said:
ImageName should be changed the Image Box name on your report.

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

Iram said:
I chugging along.
We have...
Changed the Photo field to a text field.
Added a picture name to the field i.e. 10050.jpg
Added the field to the report query.
Added the field to the report.
Added an "Image" box, and associated a pic with it (part of the
wizard),
saved it, the pic was showing.
Deleted the pic from the image "Picture" setting, it changed to (None).
Picture type is "Embedded", Size Mode is "Clip", Picture alignment is
"Centered".

Right clicked in the detail section of the report and clicked
"Properties",
Clicked on the "Event" tab then click on "On Format", [Event
Procedure]...
and copied the below into it...

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me.ImageName.Picture = "C:\More Pics2 & [Foto]"
End Sub

However when I compile this it doesn't like the "ImageName" part. What
am
I
doing wrong? Can you please help?


Thanks.
Iram/mcp









:

On Sat, 25 Jul 2009 15:49:00 -0700, Iram wrote:

Hello.
I am using Access 2003. When I pull up a record on a form or report
I
would
like to view the associated picture. The pictures reside in a folder
such as
C:\Pictures\. I don't want to embed them into the database rather I
would
like the field called "Photo" in a form and in a report to
automatically pull
a preview of a particular pic into it.
Is this possible, if so how would I make it work?

Thanks.
Iram/mcp

Set the [Photo] field (in the table) to Text datatype.
Then, using a form for data entry, enter the picture name, and it's
extension, in the [Photo] field, i.e. SummerFlowers.jpg.

To show the picture on a report....
Include the [Photo] field in the Report's record source.
Add an Image control to the report. You will have to set the Picture
property to a picture and save the change. Then, delete the control's
picture property. When done it should read (none). Save the change.

Code the Report Section's (i.e. Detail section) Format event

Me.ImageName.Picture = "C:\Pictures\" & [Photo]

To show the picture on a form...
Add the Image control to the form as above.
Code the Form's Current event as above.
 
I

Iram

That worked!

But I am trying to do the same in a Form however there is no "On Format"
Event. How do I get the pics to work in Forms?


Iram

fredg said:
I chugging along.
We have...
Changed the Photo field to a text field.
Added a picture name to the field i.e. 10050.jpg
Added the field to the report query.
Added the field to the report.
Added an "Image" box, and associated a pic with it (part of the wizard),
saved it, the pic was showing.
Deleted the pic from the image "Picture" setting, it changed to (None).
Picture type is "Embedded", Size Mode is "Clip", Picture alignment is
"Centered".

Right clicked in the detail section of the report and clicked "Properties",
Clicked on the "Event" tab then click on "On Format", [Event Procedure]...
and copied the below into it...

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me.ImageName.Picture = "C:\More Pics2 & [Foto]"
End Sub

However when I compile this it doesn't like the "ImageName" part. What am I
doing wrong? Can you please help?

Thanks.
Iram/mcp

fredg said:
On Sat, 25 Jul 2009 15:49:00 -0700, Iram wrote:

Hello.
I am using Access 2003. When I pull up a record on a form or report I would
like to view the associated picture. The pictures reside in a folder such as
C:\Pictures\. I don't want to embed them into the database rather I would
like the field called "Photo" in a form and in a report to automatically pull
a preview of a particular pic into it.
Is this possible, if so how would I make it work?

Thanks.
Iram/mcp

Set the [Photo] field (in the table) to Text datatype.
Then, using a form for data entry, enter the picture name, and it's
extension, in the [Photo] field, i.e. SummerFlowers.jpg.

To show the picture on a report....
Include the [Photo] field in the Report's record source.
Add an Image control to the report. You will have to set the Picture
property to a picture and save the change. Then, delete the control's
picture property. When done it should read (none). Save the change.

Code the Report Section's (i.e. Detail section) Format event

Me.ImageName.Picture = "C:\Pictures\" & [Photo]

To show the picture on a form...
Add the Image control to the form as above.
Code the Form's Current event as above.

Change ImageName to whatever the actual name of your Image control is
as I/we have no way of knowing what name Access assigned to the
control when you added it. On the Properties sheet of the Image
control, click on the Other Tab. The Image name is the first item.

Also this code
"C:\More Pics2 & [Foto]"
is not correct.
Change it to:
"C:\More Pics2\" & [Foto]

Note added second \ and the position of the second ".

Everything else looks OK.
 
I

Iram

I got the form to work after all. It's the "On Current" event as said in your
previous message.

I have a little problem now. Since when I was creating the image controls
using the wizard, the wizard had asked me for an actual image to embed. So I
browsed out and embedded pics, then I deleted the pics as you indicated. The
problem is, now my db is 84MB big. It was 1MB prior to the pics being
embedded. I have ran a compact and repair and it is the same 84MB. How do I
remove all those megs?
I like it small so that I can email my self backup copies...



Thanks.
Iram





fredg said:
I chugging along.
We have...
Changed the Photo field to a text field.
Added a picture name to the field i.e. 10050.jpg
Added the field to the report query.
Added the field to the report.
Added an "Image" box, and associated a pic with it (part of the wizard),
saved it, the pic was showing.
Deleted the pic from the image "Picture" setting, it changed to (None).
Picture type is "Embedded", Size Mode is "Clip", Picture alignment is
"Centered".

Right clicked in the detail section of the report and clicked "Properties",
Clicked on the "Event" tab then click on "On Format", [Event Procedure]...
and copied the below into it...

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me.ImageName.Picture = "C:\More Pics2 & [Foto]"
End Sub

However when I compile this it doesn't like the "ImageName" part. What am I
doing wrong? Can you please help?

Thanks.
Iram/mcp

fredg said:
On Sat, 25 Jul 2009 15:49:00 -0700, Iram wrote:

Hello.
I am using Access 2003. When I pull up a record on a form or report I would
like to view the associated picture. The pictures reside in a folder such as
C:\Pictures\. I don't want to embed them into the database rather I would
like the field called "Photo" in a form and in a report to automatically pull
a preview of a particular pic into it.
Is this possible, if so how would I make it work?

Thanks.
Iram/mcp

Set the [Photo] field (in the table) to Text datatype.
Then, using a form for data entry, enter the picture name, and it's
extension, in the [Photo] field, i.e. SummerFlowers.jpg.

To show the picture on a report....
Include the [Photo] field in the Report's record source.
Add an Image control to the report. You will have to set the Picture
property to a picture and save the change. Then, delete the control's
picture property. When done it should read (none). Save the change.

Code the Report Section's (i.e. Detail section) Format event

Me.ImageName.Picture = "C:\Pictures\" & [Photo]

To show the picture on a form...
Add the Image control to the form as above.
Code the Form's Current event as above.

Change ImageName to whatever the actual name of your Image control is
as I/we have no way of knowing what name Access assigned to the
control when you added it. On the Properties sheet of the Image
control, click on the Other Tab. The Image name is the first item.

Also this code
"C:\More Pics2 & [Foto]"
is not correct.
Change it to:
"C:\More Pics2\" & [Foto]

Note added second \ and the position of the second ".

Everything else looks OK.
 
N

NEWER USER

I have used a method that is much simpler with good results:

I have a table - tblPhoto with two fields Photo and Path; populate those
fields

Photo.jpg and C:\Photos\Photo.jpg

Add the Path field to your query and form; add a command button to the form
and use the On Click event

Application.FollowHyperlink Me![Path], , True

The photo should open very quickly.

Iram said:
I got the form to work after all. It's the "On Current" event as said in your
previous message.

I have a little problem now. Since when I was creating the image controls
using the wizard, the wizard had asked me for an actual image to embed. So I
browsed out and embedded pics, then I deleted the pics as you indicated. The
problem is, now my db is 84MB big. It was 1MB prior to the pics being
embedded. I have ran a compact and repair and it is the same 84MB. How do I
remove all those megs?
I like it small so that I can email my self backup copies...



Thanks.
Iram





fredg said:
I chugging along.
We have...
Changed the Photo field to a text field.
Added a picture name to the field i.e. 10050.jpg
Added the field to the report query.
Added the field to the report.
Added an "Image" box, and associated a pic with it (part of the wizard),
saved it, the pic was showing.
Deleted the pic from the image "Picture" setting, it changed to (None).
Picture type is "Embedded", Size Mode is "Clip", Picture alignment is
"Centered".

Right clicked in the detail section of the report and clicked "Properties",
Clicked on the "Event" tab then click on "On Format", [Event Procedure]...
and copied the below into it...

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me.ImageName.Picture = "C:\More Pics2 & [Foto]"
End Sub

However when I compile this it doesn't like the "ImageName" part. What am I
doing wrong? Can you please help?

Thanks.
Iram/mcp

:

On Sat, 25 Jul 2009 15:49:00 -0700, Iram wrote:

Hello.
I am using Access 2003. When I pull up a record on a form or report I would
like to view the associated picture. The pictures reside in a folder such as
C:\Pictures\. I don't want to embed them into the database rather I would
like the field called "Photo" in a form and in a report to automatically pull
a preview of a particular pic into it.
Is this possible, if so how would I make it work?

Thanks.
Iram/mcp

Set the [Photo] field (in the table) to Text datatype.
Then, using a form for data entry, enter the picture name, and it's
extension, in the [Photo] field, i.e. SummerFlowers.jpg.

To show the picture on a report....
Include the [Photo] field in the Report's record source.
Add an Image control to the report. You will have to set the Picture
property to a picture and save the change. Then, delete the control's
picture property. When done it should read (none). Save the change.

Code the Report Section's (i.e. Detail section) Format event

Me.ImageName.Picture = "C:\Pictures\" & [Photo]

To show the picture on a form...
Add the Image control to the form as above.
Code the Form's Current event as above.

Change ImageName to whatever the actual name of your Image control is
as I/we have no way of knowing what name Access assigned to the
control when you added it. On the Properties sheet of the Image
control, click on the Other Tab. The Image name is the first item.

Also this code
"C:\More Pics2 & [Foto]"
is not correct.
Change it to:
"C:\More Pics2\" & [Foto]

Note added second \ and the position of the second ".

Everything else looks OK.
 

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