How to refresh picture in sub-form
Hi again,
I've used the the menuing system and the method of changing forms captions as described in the book and from code examples in the demo application "Chamber".
I expanded a little on the sysConfig_System table. My intent was to have the menus display a different logo for each database in use so the user would have a very visible, readily apparent indication of what database they were working with.
First, I added a new field (name = LogoName, type = OLE Object) to the sysConfig_System table and then inserted a .bmp picture of a logo for the database identified in the sysConfig_System table.
Second, I modified the form fsubMenu_Logo by; a.) specifying sysConfig_System as the record source for the form, b.)adding a bound object frame specifying the field LogoName as the control source.
The result was as expected, the logo showing on each of the menus, except for one problem.
When the database is changed using the Database Links command button on frmMenu_Configuration, the form caption changes (via the subroutine RefreshOpenFormCaptions in the module basGlobal), but the database logo on frmMenu_Configuration does not change.
When I close frmMenu_Configuration and frmMenu_Main is made visible again, the logo still hasn't changed. When I then click on a command button on the frmMenu_Main form, the resulting frmMenu_xxxx form shows the new logo.
My conclusion is that the logo needs to be refreshed in each open menu form after the database has been changed, just like the form caption is refreshed. BUT - I can't figure out how to do it.
I've tried various combination of Requery/Refresh as seemed appropriate, in various locations (i.e. right after the subroutine RefreshOpenFormCaptions is called in frmMenu_Configuration, during the On Current and On GotFocus events in frmMenu_Configuration, etc.) to no avail.
How can I accomplish this?
Thanks,
Tom
Streesed spelled backwards is Desserts. Go have some ice cream when you are frustrated.
|