||Re: Display Images on the form from a local imagefolder
Ronnie MacGregor <No_Sp@m.Thanks>
||Fri, 22 Sep 2023 18:11:03 +0100
In article <5HM#17S7ZHA.1776@ip-AC1E04A7>, email@example.com
> function form_onOpen()
> //Display image for first record when form opens
> form.image2.dataSource = 'FILENAME "'+trim(form.FISH_MB1.rowset.fields['jpg_path'].value)+'\'+form.FISH_MB1.rowset.fields['jpg_name'].value+'"'
> function rowset_onNavigate(type, nRows)
> this.parent.parent.image2.dataSource = 'FILENAME "'+trim(this.fields['jpg_path'].value)+'\'+this.fields['jpg_name'].value+'"'
This type of thing can be difficult to keep track of when you have a
large form with lots of controls that need special handling on row
The way I do this sort of thing is to have the custom navigation code
encapsulated in a custom control. That custom control adds itself as an
object reference to an array when it is instantiated, and then have row
navigation code that runs through the array and fires the corresponding
object navigation code for every control referenced in the array.
Sounds complex, but it is actually much simpler to maintain once you
have lots of controls with custom navigation code.