This is Access 2000. I have a form where, if I am editing an existing record, I need to capture the existing value of a control when it gets the focus (GotFocus event) and use that value moments later to perform a calculation during the BeforeUpdate event for the same control. I used a global variable to accomplish this. I got to thinking that since the calculation assigns a value to a variable during the BeforeUpdate event, that it could be a real problem if 2 people are doing this at the same time. The value of the global variable (used to calculate the BeforeUpdate variable) could actually be changed by a second user on his workstation (during his GotFocus event) before the calculation is being run for the first user. So then I got to thinking that I should just create an invisible control in the form to house this value and work with it in that manner. I have 3 questions. Concerning the inner workings of Access' handling of data.....
1) Is it in fact possible that my scenario concerning the global variable could happen?
2) Would this second approach (creating an invisible control in the form to house the value) insure that the values for the invisible control on the form never be changed by another user in the system at the same time. In other words, if 2 users are in the form at the same time on their respective workstations, does each user have his own version of the form with values which are unique to his session.
3) Is there a way to deal with this problem as it relates to global variables. Is there a technique or a programming approach that I could be using to eliminate the multiuser risk of assigning a second value to a global variable before a calculation routine that make use of its value?
Thanks for any input!!!
1) Is it in fact possible that my scenario concerning the global variable could happen?
2) Would this second approach (creating an invisible control in the form to house the value) insure that the values for the invisible control on the form never be changed by another user in the system at the same time. In other words, if 2 users are in the form at the same time on their respective workstations, does each user have his own version of the form with values which are unique to his session.
3) Is there a way to deal with this problem as it relates to global variables. Is there a technique or a programming approach that I could be using to eliminate the multiuser risk of assigning a second value to a global variable before a calculation routine that make use of its value?
Thanks for any input!!!