I'm attempting to execute a function every time the active form changes. i can get the name of the active form using Screen.ActiveForm property but I'm looking to automatically execute the same function each time it changes. I'm hoping to do this without adding a line of code on every form's event property since i have a bunch of forms and will be adding more.
The purpose of all of this is for a user login environment, where a user can log in using their credentials allowing them additional user privileges, such as edit and delete of certain records. I'm trying to set it up so that if the user is currently logged in a label showing "Welcome, John doe" will display in the header of each form, along with a logout button, and turn the visibility on of any specific buttons to edit and delete records. And if there is no user currently logged in, only the login button will show in the header, and all the buttons allowing for edits and delete's will be hidden.
i've set up global variables for the user id (varUserID) and the current active form (frmCurrent) but its like i need an OnChange event for the frmCurrent variable or something.
Anyone have any tips or hints?
The purpose of all of this is for a user login environment, where a user can log in using their credentials allowing them additional user privileges, such as edit and delete of certain records. I'm trying to set it up so that if the user is currently logged in a label showing "Welcome, John doe" will display in the header of each form, along with a logout button, and turn the visibility on of any specific buttons to edit and delete records. And if there is no user currently logged in, only the login button will show in the header, and all the buttons allowing for edits and delete's will be hidden.
i've set up global variables for the user id (varUserID) and the current active form (frmCurrent) but its like i need an OnChange event for the frmCurrent variable or something.
Anyone have any tips or hints?
Last edited: