G
Guest
In a project I am working on I have to fill arrays (sometimes
two-dimensional) with field names. Now entering code such as :-
Set ObjectVar(1) = Staff1
Set ObjectVar(2) = Staff2
Set ObjectVar(3) = Staff3
Set ObjectVar(4) = Staff4
Set ObjectVar(5) = Staff5
is all very well but each time I try to do the same with a loop such as:-
For i = 1 to 5
Set ObjectVar(i) = "Staff" & i
Next i
I get an error 'object required'. Surely there must be a way of doing this
more efficiently? One portion of my code involves seperately using Set
ObjectVar(x, y) = fieldname about 456 times. I'd be grateful for any
suggestions.
two-dimensional) with field names. Now entering code such as :-
Set ObjectVar(1) = Staff1
Set ObjectVar(2) = Staff2
Set ObjectVar(3) = Staff3
Set ObjectVar(4) = Staff4
Set ObjectVar(5) = Staff5
is all very well but each time I try to do the same with a loop such as:-
For i = 1 to 5
Set ObjectVar(i) = "Staff" & i
Next i
I get an error 'object required'. Surely there must be a way of doing this
more efficiently? One portion of my code involves seperately using Set
ObjectVar(x, y) = fieldname about 456 times. I'd be grateful for any
suggestions.