Forms and pictures

  • Thread starter Patrick Stubbin
  • Start date
P

Patrick Stubbin

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
 
S

Stephen Lebans

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top