Could someone help me on the use of public vars to restrict the use of procedures when multiple users have a db open?
What I'm thinking about doing is creating a public var for each procedure that is relevant to the form from which it is called. I'm wondering if this would create unnecessary memory usage. For example, the variables would be -
Code:
PUBLIC VAR MODULE
public Proc1Run as boolean
public Proc2Run as boolean
And, toggle them at the beginning and end of procedures. E.G. -
Code:
sub proc1
'UNIVERSAL CODE BEHIND ALL PROC'S
if Proc1Run=true then
msgbox "Another user is updating this data. Try again later"
exit sub
else
Proc1Run=true
'REST OF THE CODE HERE
end if
Proc1Run=false
end sub
Are there any roadblocks to this approach? The other thing I'm wary of is if additional memory is going to be allocated to the public vars EACH time the db is opened in the front end. E.G. - 1 var * 5 users = 5x the memory needed for 1 var is now allocated. The other thing I'm concerned about too, is the db becoming corrupt when a write procedure gets interrupted by another user.