Pictures in access forms

  • Thread starter Thread starter Gary
  • Start date Start date
G

Gary

Hello!

I am fairly new to setting up access, but am doing quite
well, apart from.....

I need to be able to display a graphic or step through a
group of graphics that are specific to a customer on a
form.

Please can someone point me in the right direction of how
best to do this (please keep it simple!!)

Thanks - Gary
 
The simple way is to include a field in a table that is set to OLE object.
Then drag (or copy and paste) the file from windows explorer into this
field. On your form create a bound object frame and set the source to this
new field. Although this is the simple way, it is not the best way. When
you include OLE objects in a table, Access will actually store the file and
extra information. This can make the amount of memory used about twice the
size of the original file. If you don't have many pictures, this method
will work. If you ahve lots of pictures, this might cause your database to
get really, really huge.

Kelvin
 
Thanks for that Kelvin

My problem then becomes that I have several images for
each customer, so I need a different way of getting a form
to display pictures.

Maybe if theres a field with a link to a directory/file,
where the image file names start with the customer number?

Help!!!

Thanks for your time & help - it is greatly appreciated -
Gary
 
Keeping track of the filename is actually the preferred method. This way
Access is only storing text. To keep track of all the pictures, you will
need to use the exact filename (and full path) for each file. Create
another table with the CustomerID, a PictureID, and the filename. Fill this
table with the names of all the images. Then on your form have a combo box
with the record source to this new table. Then create an image on your
form. Pick any pciture for now, it will get replaced later so what you pick
doesn't matter. I have an image file that says "Image Not Available". Then
on the AfterUpdate event of the combo box put:

Me.NameOfImage.Picture = Me.cboBox.Column(2)

This will update to a new picture each time you pick from the list. I'm not
sure what you are trying to accomplish, but this should help. Good luck.

Kelvin
 
Ok Kelvin

Thanks alot for your help, I think this is going to take a
while to do, so I will try to get the basics in place
tomorrow.

Hope you don't mind if I come back to you if things go
wrong?!!

This is the first time I have used this newsgroup...
should I keep replying to this thread? or start a new one?
How long is this thread stored?

Thanks a lot again - Gary
 
Threads are stord for about 60 days. Just keep replying to the same thread.
If you don't hear back from me incase the thread is removed, then start a
new thread and put my name in it to get my attention.

Kelvin
 
I think I see where you are going with the extra table
etc. I have done what you have said, but keep getting:

Can't find the macro "me."

What I am trying to do is:

I have a form with customer details on it, I use a tab
control form to give more space for customers details. On
one of these tabs I would like to display the various
business card designs I have done for that customer.
Preferably with an "add"? button so that I can point to
the location of any new designs (jpg's) to be linked to
that customer and therefore displayed on that tab.

If there are more than one image, too be able to either
use a combo box to select image 1, 2, 3... or, to have
next / prev buttons to move between the available images
for that customer.

I hope that is clear?

Thank you. This help is invaluable!!! I have spent hours
trying to self teach access... it can be very hard work!

Cheers - Gary
 
See below:

Gary said:
I think I see where you are going with the extra table
etc. I have done what you have said, but keep getting:

Can't find the macro "me."

You must be new to Access. When I refer to code I mean to put it in the
code screen. The box in the event page is not meant for the actual code.
This tells the event what to do (run a macro, a function, run code, etc.).
So when you type something into this box, it was thinking that this was the
name of a macro. Click in this box, you should then see elipses (...)
appear to the right. Click on this. The first time you do this for a
particular event, another window will pop up with 3 choices. This is where
you tell it what type of command to run. Pick "Code Builder". This takes
you to the code screen. The next time you do this it will take you to the
same choice. This is where you would enter the code I suggested. You can
also get to this code screen by pressing Alt-F11.
What I am trying to do is:

I have a form with customer details on it, I use a tab
control form to give more space for customers details. On
one of these tabs I would like to display the various
business card designs I have done for that customer.
Preferably with an "add"? button so that I can point to
the location of any new designs (jpg's) to be linked to
that customer and therefore displayed on that tab.

If there are more than one image, too be able to either
use a combo box to select image 1, 2, 3... or, to have
next / prev buttons to move between the available images
for that customer.

I hope that is clear?

Thank you. This help is invaluable!!! I have spent hours
trying to self teach access... it can be very hard work!

Cheers - Gary

This is very clear. Sounds like an interesting database. When you get to
it, instead of the combo box, try a list box. Have it stretched along the
entire left side of the form (or tab). This will show you how many images
threre are. Then clicking on the name will bring up the appropriate image.
It's a matter of preference, but I think it is much easier to pick from a
list box if you are going to repeatedly be picking something. The code
would be the same either way. Or you could just use a continuous subform
and show all the images without having to pick. The extra table will fit
perfectly with a subform. If you have a lot of images for one client then
you would just need to scroll.

Kelvin
 
Whoo Hoo!!!
It works YAY!!!! You are a STAR!

Ahem....Compose myself!

As you guessed I am new to access, and self teaching
something like access is very difficult and very time
consuming, but thanks to you it just got a little easier -
and you have saved me a lot of time - THANK YOU!

The only other thing I would like to know for this part of
my database is how to add the location of new graphics
files without having to type the path into the new table -
Is it not possible to have an "add" button on the form,
which will pop up a window similar to the "open" window to
point to the location so that the address is stored
against that customer automatically?

Thanks - Gary
 
Back
Top