Soul777Toast
02-27-2008, 03:00 PM
Hi All, this is my first post here!
My question is, is there any way to access the value of a variable that has been declared in one form from another form without having to use a global variable?
The specifics: I have a form (formA) with a button that launches another form (formB) with textboxes for values and an add button, and allows the user to enter in dimensions for a chart that will be created later. I want to allow the user to do this as many times as they want (to create as many charts as desired), and I want to store these dimensions in a variable size multidimensional array (arrayA) in formA (so I can pass them to a function that will create the forms), so the process I'd like to follow is to store the values in the array of dimensions in a temporary array (arrayB) in formB, redimension formA to add a new record, repopulate arrayA with its original values, and then add the new values into the new space in arrayA. To do this, I will need to be able to access arrayA which is declared in formA from formB.
I know that you can access the values of controls in one form from another (for example, formname.controlname.value), which is what makes me wonder if it is possible to do this with variables in some way (I've tried formname.variablename, but it doesn't work).
I also know that I could just use a globabl variable, but I'm a bit of a code perfectionist and I don't like using global variables if I can avoid it ;P
Any help here would be appreciated, thanks in advance!
My question is, is there any way to access the value of a variable that has been declared in one form from another form without having to use a global variable?
The specifics: I have a form (formA) with a button that launches another form (formB) with textboxes for values and an add button, and allows the user to enter in dimensions for a chart that will be created later. I want to allow the user to do this as many times as they want (to create as many charts as desired), and I want to store these dimensions in a variable size multidimensional array (arrayA) in formA (so I can pass them to a function that will create the forms), so the process I'd like to follow is to store the values in the array of dimensions in a temporary array (arrayB) in formB, redimension formA to add a new record, repopulate arrayA with its original values, and then add the new values into the new space in arrayA. To do this, I will need to be able to access arrayA which is declared in formA from formB.
I know that you can access the values of controls in one form from another (for example, formname.controlname.value), which is what makes me wonder if it is possible to do this with variables in some way (I've tried formname.variablename, but it doesn't work).
I also know that I could just use a globabl variable, but I'm a bit of a code perfectionist and I don't like using global variables if I can avoid it ;P
Any help here would be appreciated, thanks in advance!