Several years ago I wrote a generic Start Module which provides user Login/Password, Auto Hide, Remote Shutdown/Lockout and User Level features that could be easily adapted to existing Main Forms ... am using this on several 2003/2016 db application files and allows for nightly orderly shutdowns prior to backups ... unfortunately I ran out of time during the initial project so never completed any of the downstream user level logic. ... at present I need to now add user level restrictions to an existing Main Form
Consider the Start Logic just runs in the background as a hidden Object and contains Global Values for Machine, User, and User Level
The main form I am working with consists of a sidebar with a number of option group buttons and the main part of the form consists of several overlaid Subforsms (one subform for each button minus the exit button) The control logic for the Option Group selects the appropriate subform by making it visible then hides the rest of the subforms.
What has me stumped is: my expectation is that the Main Form Form_Open/Form_Load logic would run before any of it's subforms ... I actually peppered all the subforms and main/parent form with debug.print statements and to my dismay the MainForm is not even being called until after I click one of the buttons
The default subform is visible by default so the form does appear to work properly in spite of not having run the main Form_load routine ... the other curiosity is the Form_load that is being run first is for a subform that has visible set to false
for the user level logic to work, the main form load must determine which buttons on the option group are not allowed for a specific level ... if the main form_load isn't being run then all the buttons are available
Thoughts on how I can determine/fix/force the order that ACCESS fires the Form_load routines? Would I need to use a global State Machine flag that aborts a Form_load if it runs before its expected state? With the overlay subforms I could well imagine all of the forms initially loading but still expect the main form Load to occur first.
Neither seems to be happening ... there is only one form_load firing for this invisible subform ... could this situation have something to do with the Send to Back/Front functionality? Even though the form that is loading is set to invisible perhaps it is the topmost form? How can I prove that ... hmm maybe set visible to true and see if it pops up on load
Consider the Start Logic just runs in the background as a hidden Object and contains Global Values for Machine, User, and User Level
The main form I am working with consists of a sidebar with a number of option group buttons and the main part of the form consists of several overlaid Subforsms (one subform for each button minus the exit button) The control logic for the Option Group selects the appropriate subform by making it visible then hides the rest of the subforms.
What has me stumped is: my expectation is that the Main Form Form_Open/Form_Load logic would run before any of it's subforms ... I actually peppered all the subforms and main/parent form with debug.print statements and to my dismay the MainForm is not even being called until after I click one of the buttons
The default subform is visible by default so the form does appear to work properly in spite of not having run the main Form_load routine ... the other curiosity is the Form_load that is being run first is for a subform that has visible set to false
for the user level logic to work, the main form load must determine which buttons on the option group are not allowed for a specific level ... if the main form_load isn't being run then all the buttons are available
Thoughts on how I can determine/fix/force the order that ACCESS fires the Form_load routines? Would I need to use a global State Machine flag that aborts a Form_load if it runs before its expected state? With the overlay subforms I could well imagine all of the forms initially loading but still expect the main form Load to occur first.
Neither seems to be happening ... there is only one form_load firing for this invisible subform ... could this situation have something to do with the Send to Back/Front functionality? Even though the form that is loading is set to invisible perhaps it is the topmost form? How can I prove that ... hmm maybe set visible to true and see if it pops up on load