Solved Copying subform array to parent form array

TonyE

Registered User.
Local time
Today, 13:27
Joined
Apr 11, 2019
Messages
23
You cannot seem to declare an array PUBLIC so I cannot see how to copy one array from subform into main form array ......
Anyone know if this is possible ?
 
Can you show us the code you're trying to use? I don't understand the relevance of main form and subform in this context.
 
I know can copy out to a table then back into array if want to ........ just wondered if a better more direct method
 
All I am doing is saving into an array when an field gets updated from multiple subforms (into an individual arrays) i.e. subformA has arrayA, subformB has arrayB etc ........ want to then accumulate all arrays to say an array arrayAll then use this arrayAll to perform actions in main form on just the updated fields. Unless you know an easier way to do this ? Application is very complex pushing the bounds of MS Access.
 
All I am doing is saving into an array when an field gets updated from multiple subforms (into an individual arrays) i.e. subformA has arrayA, subformB has arrayB etc ........ want to then accumulate all arrays to say an array arrayAll then use this arrayAll to perform actions in main form on just the updated fields. Unless you know an easier way to do this ? Application is very complex pushing the bounds of MS Access.
Hi. Just thinking out loud... Would using a Collection to put all your arrays into one object work for you?
 
Hi. Just thinking out loud... Would using a Collection to put all your arrays into one object work for you?
Never used Collections before ...... looking at examples and yes may well do what I need.
You can define Collections as PUBLIC as well.

Thanks will give it a go.
 
Never used Collections before ...... looking at examples and yes may well do what I need.
You can define Collections as PUBLIC as well.

Thanks will give it a go.
Good luck! Let us know how it goes...
 
There is no "array" control type so I'm not sure what you are trying to do. A text field is not an array but you can put data that looks like an array into it. And logically, it makes no sense to have data from a subform which by definition is the many-side of a 1-many relationship on the main form so that completes my confusion. If you can post a picture of the form, that might clarify what you are trying to accomplish.
 
I just tested the declaration and use of a global string array and had no problem.
Yes I just stumbled across this also ......... didn't expect GLOBAL to work ok since PUBLIC doesn't. Anyway this solves my requirement can now just use a single array rather than many and merging.

Thanks for the suggestion had I not already gleaned this, you would have been been the man, cheers.
 
Thanks everyone for the fast response, will finalise my coding ref this issue tomorrow.
 
Yes I just stumbled across this also ......... didn't expect GLOBAL to work ok since PUBLIC doesn't. Anyway this solves my requirement can now just use a single array rather than many and merging.

Thanks for the suggestion had I not already gleaned this, you would have been been the man, cheers.
Glad to hear you got it working !!
 

Users who are viewing this thread

Back
Top Bottom