emmahope206
New member
- Local time
- Today, 15:18
- Joined
- Oct 21, 2020
- Messages
- 2
Hi All,
I have a complex master database that is used to refresh the data in multiple smaller databases for groups of users in different business divisions, each one having different populations and a significant number of other factors too numerous to mention.
Simply put, I have numerous arrays defined, each with lists of table names, different 'actions' are then performed on each of these. By 'actions', I mean, one group of tables might be cut down by joining on 1 specific field, another group of tables might be cut down on 2 other specific fields etc and so on and so on.
My arrays are called strArr01, strArr02, strArr03, strArr04 etc etc. Some of the actions need to be repeated (such as 'drop table') on multiple arrays
...repeat for strArr02....repeat for strArr03....repeat for strArr04 etc etc etc.
i was hoping to be able to do something like
For j = 0 to 100 '(lets assume there are 100 arrays)
and then refer to "strArr0" & (j) in some way to be able to loop through these but this does not work.
Is there some method where I can 'indirectly' refer to the name of my array in this method? Please can someone advise?
Thanks
I have a complex master database that is used to refresh the data in multiple smaller databases for groups of users in different business divisions, each one having different populations and a significant number of other factors too numerous to mention.
Simply put, I have numerous arrays defined, each with lists of table names, different 'actions' are then performed on each of these. By 'actions', I mean, one group of tables might be cut down by joining on 1 specific field, another group of tables might be cut down on 2 other specific fields etc and so on and so on.
My arrays are called strArr01, strArr02, strArr03, strArr04 etc etc. Some of the actions need to be repeated (such as 'drop table') on multiple arrays
Code:
For i = 0 To UBound(strArr01)
strSQL01 = "DROP TABLE [" & strArr01(i) & "]"
db.Execute strSQL01, dbFailOnError
Next i
...repeat for strArr02....repeat for strArr03....repeat for strArr04 etc etc etc.
i was hoping to be able to do something like
For j = 0 to 100 '(lets assume there are 100 arrays)
and then refer to "strArr0" & (j) in some way to be able to loop through these but this does not work.
Is there some method where I can 'indirectly' refer to the name of my array in this method? Please can someone advise?
Thanks