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

Linking Images

Status
Not open for further replies.

Hookstrat

Technical User
Jun 11, 2002
43
US
Sorry for re-posting, but this problem is really bugging me. I have been working on this database for a long time and if I can just get these maps to display correctly I can put this beast to rest. I'm still having trouble linking images. I have a table with two fields... [Map] which contains linked maps from the directory "c:\mydocuments\sanitarymaps" and [ID] which is just an autonumbered field. All of my maps are saved as the corresponding records autonumber. So the map for the first record is simply "1.jpg". I have a bound image control named Map and I set the form's properties as "Picture - (none)" and "Picture Type - Linked". Then I put this code into the On_Current Event of the form.
Code:
Private Sub Form_Current()
If Me![ID] <> 0 Then
           
        Me!Map.Picture = &quot;c:\MyDocuments\SanitaryMaps\&quot; & Me![ID] & &quot;.jpg&quot;
    End If

End Sub
[\code]
Unfortunately the debugger keeps saying: Run-time error &quot;438&quot; - Object doesn't support this property or method.  How can I get Access to automatically display the correct picture in my form??  If someone can tell me what I am doing wrong I would really appreciate the help.  Thanks in advance for any suggestions.                L.H.
 
just read you other post do you have the correct graphic filters installed

pasted from access 97 help do a search on jpg

However, you do need a separate graphic filter installed to insert all other graphic file formats listed below.

Graphic file formats requiring separate graphic filters
AutoCAD Format 2-D (.dxf)
Computer Graphics Metafile (.cgm)
CorelDRAW (.cdr)
Encapsulated PostScript (.eps)
Graphics Interchange Format (.gif)
JPEG File Interchange Format (.jpg)
Kodak Photo CD (.pcd)
Micrografx Designer/Draw (.drw)
PC Paintbrush (.pcx)
Portable Network Graphics (.png)
Tagged Image File Format (.tif)
Targa (.tga)
WordPerfect Graphics (.wpg)
HG Graphics Language (.hgl, plt)
Macintosh PICT (.pct)
 
Well, I would use the OLE Bound Control. To activate the picture use something like below in your Current event.

OLEBound0.Class = &quot;MSPhotoEd.3&quot;
OLEBound0.SourceDoc = <My JPG file name>
OLEBound0.Action = acOLECreateLink
OLEBound0.Action = acOLEUpdate

Personally, this is not the way I would do it. The load time for this control is way too slow (1 second or over). Use the Kodak control instead. It loads pics in a quarter of a second over a LAN or filesystem.

Gary
gwinn7
A+, Network+
 
Try this format:

Me![Map].Properties(&quot;Picture&quot;) = &quot;c:\MyDocuments\SanitaryMaps\&quot; & Me![ID] & &quot;.jpg&quot;

I answered a similar question a while back that may help also.

Thread702-289543

Good luck
Bob Scriver
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top