I have a program that creates several instances of a form.
I also have a Module which includes a global array so as to allow all of the instanced forms to have access to.
My question is: What happens when several forms try to access AND change that array? Can 2 or more instanced forms access the same indexed area of an array and change it or does windows intervene and prevent another form from changing this array while another is working on it (and once done it allows the other to do whatever it wants to it as well)?
I was thinking of accessing this global array inside the form itself like so:
private sub form_load()
Global_Array(0)= Global_Array(0) & "Hello" 'Global_Array() is defined in Module1.bas
Global_Array(1)= Global_Array(0) & Global_Array(1) & "Hi"
Global_Array(2)= Global_Array(0) & Global_Array(1) & Global_Array(2) & "Aloha"
BUT if i have several instances that are also created and who also change this global array i am wondering if it gets really messy or does windows halt an instance while another instance is working on the same index area of an array.
If it is messy then what about this idea: I place a procdure inside the Module1.bas file which includes an argument to the form object. With this i now know who is calling me and say maybe i have a static variable which tells me which form was in here last and if it isn't set to NULL then that tells me someone is still in here and so i should go into an infiinite loop until this static variable is set back to NULL. Take a look:
public sub Change_Global(thisform as form1)
static lastform as form1
if lastform <> Nothing then
loop until lastform = Nothing
Set lastform = thisform
What I'm presenting in this article is the result of 2 conditions in my work area:
We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…