Forms and pictures

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I store rather large bmp files and need to display them on a form, rather
than store them directly into a table i store them separately and am trying
to refer to the location only.

viz:

the code behind the form is:
Option Compare Database


Private Sub Form_Current()
On Error Resume Next
If Not IsNull(Me![ImagePath]) Then
Me![ImageFrame].OLETypeAllowed = 1
Me![ImageFrame].SourceDoc = Me![ImagePath]
Me![ImageFrame].Action = 0
End If
End Sub
Private Sub ImagePath_AfterUpdate()
On Error Resume Next
Me![ImageFrame].OLETypeAllowed = 1
Me![ImageFrame].SourceDoc = Me![ImagePath]
Me![ImageFrame].Action = 0
End Sub

all that happens is the originally identified bmp file (to get the unbound
control to appear) displays, and no other: a copy of the imagepath field is
shown below:

C:\Documents and Settings\OEM Customer\My Documents\Business cards\Patrick
Stubbin.BMP

I just cant get it to display bmp files for any record......HELP
 
Do not use either of the OLE Object Frame controls. Use the Image
control instead.

Chnage your code to something like:

Private Sub Form_Current()
On Error Resume Next
If Not IsNull(Me![ImagePath]) Then
Me.NameOFYourImageControl.Picture = Me![ImagePath]
End If
End Sub

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
Back
Top