Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Desperate Help needed PLEASE!!

Status
Not open for further replies.

shiggyshag

Programmer
Dec 14, 2001
227
GB
HI

I have an ACCESS 2 database Yes Access 2.
What I need to do is display a Diffrent Photo for each record. But i do not want to store the picture in a table I want to use a directory on the harddrive to hold the pics.

How do I do it?

I have tried Linked but cant get it to cahnge for each record.

Any help would be great

Cheers
 
Um, maybe referencing to the Scripting.FileSystemObject would work? Once you make a reference of that, it has all sort of methods that will allow you to access the hard drive. I used that to process ceratin .doc files in my HD, so I think this should work as to knowing what graphic files are in your HD and maybe match their file names with each record? But I'm not sure how you would display each picture once you get it's file name and path. Maybe create an instance of a photo editer using CreateObject, or Shell? Not sure at all. Um and since you are using Access2, I don't know if any of these would work, since I've had no contact with Access2 whatsoever. Well just a few ideas, sorry couldn't help much. If what I said sounds like a stupid idea, then don't listen to me :p
 
What you need to do is this:

Store the full path to your image in a field in your record

On the form where you wish to display the image place an image control

You will be prompted for a file name of an image - point it to any image for now.

Place a textbox field bound to your field that contains the path to the image on your form (call this field ImagePath)

Using the FORMS OnCurrent event set the picture property of your image control to the field in which you have the stored the path to your image - use the following syntax (assuming that you call your image control Image1):

me.Image1.Piture = me.ImagePath

test your form, the image should update itself everytime you move between records!

HTH

Jamie Gillespie
j-gillespie@s-cheshire.ac.uk
 
SORRY, Typo

the code line should read:

Me.Image1.Picture = Me.ImagePath
Jamie Gillespie
j-gillespie@s-cheshire.ac.uk
 
Don't know about access2, but the way I did it is as follows:

1) I have a table containing the location and name of the pics (I do this in vba according to the contents of a certain directory)

2) My records form contains an image control.

3) In the "On Current" event, I check if the record has a picture for it (dlookup), if yes, I make the image control visible, and assign the lookedup location and name to the picture field of the image control, if not the image control is invisible.

hth
(if you need the coding for this let me know)
Riny
 
HI

Thank you JGillespie but this isnt available in access2 .Picture you have a SourceDoc but I tried how you said but had no luck

Cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top