-----Original Message-----
This image issue is one of the biggest bugaboos on these
forums. There is no realistic way to use the OLE type
field because of bloat and SEVERE database/application
degradation. I once added 50 jpgs and my db became 300
megs.
See Microsot Article 210100 for the technique of loading
the images' filenames into an unbound image control. Also
see 158941 on how to "bulk'load the image file and path
names into your table. Note - this article will also
actually store the images themselves so you need to
comment out the code which creates the images.
Here is sample code that does it :
Private Sub cmdLoadOLE_Click()
Dim MyFolder As String
Dim MyExt As String
Dim MyPath As String
Dim MyFile As String
Dim strCriteria As String
MyFolder = Me!SearchFolder
' Get the search path.
MyPath = MyFolder & "\" & "*." & [SearchExtension]
' Get the first file in the path containing the file
extension.
MyFile = Dir(MyPath, vbNormal)
Do While Len(MyFile) <> 0
[OLEPathName] = MyFolder
[OLEFileName] = MyFile
[DateCreated] = FileDateTime(MyFolder & "\" & MyFile)
[Category] = "NewRecord"
'[Size] = FileLen(MyFolder & "\" & MyFile)
' Check for next OLE file in the folder.
MyFile = Dir
' Go to new record on form.
DoCmd.RunCommand acCmdRecordsGoToNew
Loop
End Sub
Regards
Matthew
-----Original Message-----
There is a better way, without actually storing the JPGs
in your db. Assuming the JPGs are sitting in a directory
somewhere:
- add a field or two to your table for file path and file
name;
- add an unbounded image to your form;
- in the OnCurrent event for the form, add code similar to
this:
Me!NameofImageField.Picture = [FilePath] + [FileName]
The correct picture should then display for each record
when the form is opened.
Works great for me. Hope that helps you.
-----Original Message-----
Sorry, I should have clarified. They need the .jpgs to
display the images instead of icons in the OLE field on
their forms and reports. Anyone got any ideas--other than
creating a new image through a separate image editing
program (see
http://support.microsoft.com/default.aspx?
scid=kb;en-us;258644)?
Thanks!
-----Original Message-----
I think I've found all the KB has to say about .jpg
images on forms and reports, especially article 258644.
But that's an article specific to Access 97, and as much
as I know it's a bad idea, I have an Access 2000/2002
mulituser database and they want .jpgs in an OLE field.
Can anyone give me a lead on how to make that happen? I
know .bmp and .wmf formats are supported, but these guys
are low on tech savvy and are swimming in .jpgs they
want
in their database. I'm also aware of the database bloat,
and they can live with that. But surely there's some
hope
other than creating a new image through a third-party
image application every time they enter a picture...?
Thanks...
.
.
.
.