I am using a local db which I will not be splitting. The intention is to only allow one person to have it open at a time to avoid entry conflicts and for speed.
Currently, if user A has the db open and user B attempts to open it, he gets the error 'The database has been placed in a state by user 'Admin' on machine ...". This is good, as it prevents it from being opened, but I'd like to use my own msgbox error which will indicate the exact person that has it opened (in the event it's left opened unintentionally so we can track down that user). I tried to use sub main() in a module but it doesn't work. I plan to write to a table the current users name on main form load, then on form unload, delete this user. When user 2 goes to open it, I want it to say 'Currently open by user As name, try again later".
Is there any function that gets called in VBA prior to the error above?