Generally, the practice of storing images in Access tables isn't
recommended due to the reasons outlined in the article "Handle/Display
images in forms/databases". A workaround is to store the path to the image in a
text field instead and assign it to an image control's Picture property
at runtime by using code similar to the following snippet: (ImagePath is
the name of the field containing the filename and path of the images)Private Sub Form_Current()
With Me
.imgImageDisplay.Picture = .ImagePath
End With
End Sub
However, if the image files are moderately large, and if the user tries to
quickly navigate to different records by using the built in navigation buttons
before the "Loading Image" asynchronous dialog closes, the
result is either a General Protection Fault in Access, or the
message "Out Of Stack Space" before Access terminates.
A workaround is to disable the built-in navigation buttons before assigning
a new filename to the Image control's Picture property. If you are using
custom Navigation buttons on your forms, you will have to temporarily disable
them in the same fashion.
Private Sub Form_Current()
With Me
.NavigationButtons = False
.imgImageDisplay.Picture = .ImagePath
.NavigationButtons = True
End With
End Sub
|