I have used Paul Bent's methot of viewing jpeg images successfully for a single form. However I have a smaller image which I wish to display on a different form. Accordingly I copied the code to another Script changing all the parameters so that the correct image etc was selected in the second Script. The Scipts function correctly if run from a button with the script attached to it on both forms.
However the small image does not change on Record Change in its form whereas the original image on its form does. I understood that this was controlled by the DocWindow and amended Paul's code accordingly as shown below. My question is why does the small image not change when the Record Changes?
Sub Newrecord(Source As Docwindow)
On Error Goto ErrTrap
'DocWindow object represents the active window
'Test for the view name else the code will try to fire on every view
If CurrentView.Name = IMG_VIEW_NAME Then
LoadImageFromFile
Elseif CurrentView.Name = SIMG_VIEW_NAME Then
LoadSImageFromFile
End If
Goto ExitSub
ErrTrap:
Msgbox "Error " & Format$(Err, "#0") & " - message: " & Error$, 16, "System Error"
Resume ExitSub
ExitSub:
However the small image does not change on Record Change in its form whereas the original image on its form does. I understood that this was controlled by the DocWindow and amended Paul's code accordingly as shown below. My question is why does the small image not change when the Record Changes?
Sub Newrecord(Source As Docwindow)
On Error Goto ErrTrap
'DocWindow object represents the active window
'Test for the view name else the code will try to fire on every view
If CurrentView.Name = IMG_VIEW_NAME Then
LoadImageFromFile
Elseif CurrentView.Name = SIMG_VIEW_NAME Then
LoadSImageFromFile
End If
Goto ExitSub
ErrTrap:
Msgbox "Error " & Format$(Err, "#0") & " - message: " & Error$, 16, "System Error"
Resume ExitSub
ExitSub: