lornemcauley
03-12-2009, 06:59 AM
Hi everyone,
I have an application that has a simple login. At login, the userid and name are stored inside global variables that are declared inside a module. Then on the main form it says "Hello (username)". Pretty simple.
So here's what happens:
1. Off the main form I have several buttons that open other forms. Here is example code of opening another form:
DoCmd.Close
DoCmd.OpenForm "Access_Control", acNormal, "", "", , acNormal
2. On one of these other forms, there is some simple data entry that is validated. User is notified of bad data using messageboxes.
3. If a message box pops up, my global variables are reset! I do not programatically change my global variables except for when they are set when the user completes the login screen.
I've added watches to my globals and it always happens on these damn messageboxes. So what's happening is a user will login, see the home screen with their name on it, go fill out a form, come back to the main screen and their name field is blank.
Very frustrating. Is it due to the way I open / close windows? Are the globals being reset during a split second when the windows are closed?
Any help would be greatly appreciated. No I don't want to store this information inside a table.
Thanks,
Lorne.
I have an application that has a simple login. At login, the userid and name are stored inside global variables that are declared inside a module. Then on the main form it says "Hello (username)". Pretty simple.
So here's what happens:
1. Off the main form I have several buttons that open other forms. Here is example code of opening another form:
DoCmd.Close
DoCmd.OpenForm "Access_Control", acNormal, "", "", , acNormal
2. On one of these other forms, there is some simple data entry that is validated. User is notified of bad data using messageboxes.
3. If a message box pops up, my global variables are reset! I do not programatically change my global variables except for when they are set when the user completes the login screen.
I've added watches to my globals and it always happens on these damn messageboxes. So what's happening is a user will login, see the home screen with their name on it, go fill out a form, come back to the main screen and their name field is blank.
Very frustrating. Is it due to the way I open / close windows? Are the globals being reset during a split second when the windows are closed?
Any help would be greatly appreciated. No I don't want to store this information inside a table.
Thanks,
Lorne.