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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OLE - JPEG images 2

Status
Not open for further replies.

raymondo

Technical User
May 3, 2002
86
AU
I use two color jpeg images in my forms and the same but in black & white on my reports.
Rather than inserting them as images in each place they're used, is it possible to store them only once, in a table for instance, and access them as needed in my forms and reports?
I've tried creating a table with OLE objects that reference the jpeg files but when I use them in my forms/reports all I see is the file name and the application which this file type is linked to - in my case Photoshop!
Any help or suggestions appreciated.
 
Yes, what I do (Access 2000) is put the images in a subfolder under the folder containing the mdb; then use the following sort of code on the OnOpen event of the form:

DIM F as Form:set F = me
F.Picture = CurrentProject.Path & "\Images\YourImage.gif"

Make sure that the PictureType property is set to 'Linked', and all should be OK.


Cheers,

Steve Lewy
Solutions Developer
steve@lewycomputing.com.au
 
Steve,
Tried that but Access 2000 insists on having an image with a valid pathname as the default value otherwise I get the message
Access cannot open imagename
When I move the DB from one location to another this means, that to avoid this message, I'll have to set up the correct imagename & path for each image control in each Form/Report - hardwired as it were!!!
Do you have this problem?
Raymondo
 
Raymondo,
What I do is have the value of the Picture property set to (none) in the Design view, and only set up a value into this property via the OnOpen event. Whilst I havnt tried it, this approach should work without problem in your situation, as it doesnt have to test for the existance of the image at design time.
Hope this helps, Cheers,

Steve Lewy
Solutions Developer
steve@lewycomputing.com.au
 
I had a similar problem with a photo database. I opted to store the Path in a table with just the one field. I then stored the File name in the record and strung them both together when I needed them

I can let you have a copy of the database if you want please e mail me with Photo Database in the subject

[bigglasses] Neil Berryman
IT Trainer
neil_berryman@btopenworld.com
 
Thanks Steve, It was only that I hadn't set the Picture property to None. Duhhh!
And Neil, I'd be interested in the phot db and have sent you an email accordingly.
Many thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top