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

Document Window problem

Status
Not open for further replies.

hthal

Technical User
Jan 1, 2006
2
GB
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:
 
Found the problem. Since the form showing the smaller image contained a repeating panel, this prevents the DocWindow events relating to Paul Bent's scipt firing correctly. So I moved the repeating panel to another form and everything relating to the smaller and larger images works correctly.

But thanks for the posting!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top