Subject Re: Closing an image on a form
From Akshat Kapoor <akshat.kapoor@kapoorsons.in>
Date Sat, 10 Apr 2021 14:45:46 +0530
Newsgroups dbase.getting-started

Good Afternoon Roy,

>
>     function form_onNavigate()
>            mphoto = form.testimagedatamodule1.cactusdb_dbf1.rowset.fields["photoyesfile"].value
>                 do case
>                 case mphoto = '01'
>                    //add code here to navigate to correct record in photos01_dbf1
>          form.testimagedatamodule1.dataSource =  form.testimagedatamodule1.photos01_dbf1.rowset.fields["photo"]
>        case mphoto= '02'
>                   //add code here to navigate to correct record in photos02_dbf1
>           form.testimagedatamodule1.dataSource =  form.testimagedatamodule1.photos02_dbf1.rowset.fields["photo"]
>        case mPhoto = '03'
>                   //add code here to navigate to correct record in photos03_dbf1
>           form.testimagedatamodule1.dataSource =  form.testimagedatamodule1.photos03_dbf1.rowset.fields["photo"]
>        endcase
>        return

This is in addition to what Mervyn has said.
There is a form_onNavigate event but when will it fire I do not know.
This is the first time I am reading about this.

Copy the above code to clipboard.

Open the form in designer and select the inspector to view the properties.
There will be a property called testimagedatamodule1
Click on "I" to inspect it.
One of the properties will be cactusdb_dbf1

Click on "I" to inspect it

There will be a property called rowset.

Inspect this.

Now click on the events tab.
Click on onNavigate and the spanner at its side.

Editor will appear with cursor in between an event. Paste the above code
in that event.

Make the changes Mervyn has recommended.

Save the changes.
Save and close the form.

Hopefully your problem should be solved.

The rowset_onNavigate fires whenever there is navigation in the rowset.
It is at that time that you will be wanting to change the images. Hence
the change in event.

Regards
Akshat