Solved Copying subform array to parent form array (1 Viewer)

TonyE

Registered User.
Local time
Today, 03:21
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 ?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 03:21
Joined
Oct 29, 2018
Messages
21,494
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.
 

TonyE

Registered User.
Local time
Today, 03:21
Joined
Apr 11, 2019
Messages
23
I know can copy out to a table then back into array if want to ........ just wondered if a better more direct method
 

TonyE

Registered User.
Local time
Today, 03:21
Joined
Apr 11, 2019
Messages
23
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.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 03:21
Joined
Oct 29, 2018
Messages
21,494
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?
 

TonyE

Registered User.
Local time
Today, 03:21
Joined
Apr 11, 2019
Messages
23
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.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 03:21
Joined
Oct 29, 2018
Messages
21,494
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...
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 06:21
Joined
Feb 19, 2002
Messages
43,352
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.
 

TonyE

Registered User.
Local time
Today, 03:21
Joined
Apr 11, 2019
Messages
23
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.
 

TonyE

Registered User.
Local time
Today, 03:21
Joined
Apr 11, 2019
Messages
23
Thanks everyone for the fast response, will finalise my coding ref this issue tomorrow.
 

Isaac

Lifelong Learner
Local time
Today, 03:21
Joined
Mar 14, 2017
Messages
8,778
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

Top Bottom