Adding photos to a database...

  • Thread starter Thread starter Nick Goldman
  • Start date Start date
N

Nick Goldman

I work as a drag racing announcer, and am in the process of creating a
database of various cars/drivers. One important aspect of the database is a
photo of the car and or driver to appear on each database sheet (a different
photo for each page). What I've gotten out of access's help file is to
create a bound object frame, and insert the picture into the frame. I do
that, but the picture appears on every page (same as unbound), when i exit
and restart access, the picture is gone. I have tried both embedding and
linking the photo to no avail. Any help would be greatly appreciated.
-Nick Goldman
Raceway Park Track Announcer
 
Nick,

Look at the Northwind database that came with access. It
has the use of photos in the employee table. See how they
are inserted there and see if that will help you. I find
that most anything that is complex can be found in this
example database and it is a big help, you just have to
deciffer the properties sometimes.

Kevin
 
Kevin,
I tried looking at the Northwind database. I feel like I'm in way over my
head. This is the first database I've compiled...and I have a 1 year
beginners visual basic class under my belt (but I don't remember ANYTHING
from it!) The concept of adding a photo to an individual page seems very
easy...I can't understand why it's not working. Perhaps you have a simple
instruction for doing it? The northwind database uses command buttons to
load the employee photos. Honestly, I don't need anything like that...just
a box for them. I am the only one who will be using the database, and it
just needs to have a small box for a car picture. Help!
Thanks,
Nick Goldman
 
Nick,

You're using the wrong control - use an image control. Store the path to the
picture of each car in the table that is the basis of your form. Then in the
OnCurrent event of the form you need code that sets the Picture property of the
image control to the value of the path for the current record. Looks like this:

Me!NameOfImageControl.Picture = Me!HiddenTextBoxName

HiddenTextBoxName is a textbox on your form bound to the field in your table
that holds the path. The visible property of the textbox is set to False.


--
PC Datasheet
A Resource for Access, Excel and Word Applications
(e-mail address removed)
www.pcdatasheet.com

· Design and basic development for new applications
· Additions, Modifications and "Fixes" for existing applications
· Mentoring for do-it-yourselfers who want guidance
· Complete application design and development
· Applications Using Palm Pilot To Collect Data And
Synchronize The Data Back To Access Or Excel
 
Nick,

You're using the wrong control - use an image control. Store the path to the
picture of each car in the table that is the basis of your form. Then in the
OnCurrent event of the form you need code that sets the Picture property of the
image control to the value of the path for the current record. Looks like this:

Me!NameOfImageControl.Picture = Me!HiddenTextBoxName

HiddenTextBoxName is a textbox on your form bound to the field in your table
that holds the path. The visible property of the textbox is set to False.


--
PC Datasheet
A Resource for Access, Excel and Word Applications
(e-mail address removed)
www.pcdatasheet.com

· Design and basic development for new applications
· Additions, Modifications and "Fixes" for existing applications
· Mentoring for do-it-yourselfers who want guidance
· Complete application design and development
· Applications Using Palm Pilot To Collect Data And
Synchronize The Data Back To Access Or Excel
 
Sorry for sounding like I have no idea what I'm doing. That's because I
really don't! I tried the image control, but I am forced to choose an image
as soon as I insert the image box. The picture property only lets me change
the photo, but it changes on all databases. The help file lists the Image
Control as a box that will display the same photo on every page, and says
basically that what I need is the Bound OLE Object.
-Nick Goldman
 
Nick

1. Access is very inefficient in storing graphics.
Storing graphic blobs in your database will bloat your
database a lot. Thus, it is more efficient to store the
graphic files separately from the database as PCDatasheet
wrote. I normally create a directory "{DirToDatabase}
\Graphics" and store all the graphics I use in the
database. You then only store the pathnames (relative if
you fancy a bit of coding) of the graphic files in the
database.

2. The image Access asks you to select is simply a
starting image. Pick anything, preferably a very small
image. The code PCDatasheet suggested for the
Form_Current Event will replace the starting image with
the proper immage as you move from one Record to the next.

HTH
Van T. Dinh
MVP (Access)
 
I have attempted what pc datasheet suggested. I'm still lost. I tried the
code, text box, and image control. I now get errors coming up with the line
of code. Would anyone be willing to take a look at the file? It is 56 kb
in a compressed folder. It would be greatly appreciated.
Thanks,
Nick Goldman
 
Back
Top