Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamically select array and item in array

Status
Not open for further replies.

jkafer

Technical User
Feb 13, 2004
32
US
I have, what I feel a simple problem. basically I've been thinking about it too long today!

I have 3 arrays - shown here very simply:

arrA = array("A", "a", "X")
arrB = array("B", "b", "X")
arrC = array("C", "c", "X")

I have 3 fields in my table - simply:
ID Category Item
1 A 1
2 C 2

What I would like to do is dynamically get the data out of the appropriate array.

Record 1: arrA(1)
Record 2: arrC(2)

No matter what I try I can't get it to do that. Basically I want to 'build' and 'execute' arrA(1), but it's the execute that won't work.

Does that make sense?

Any help appreciated.
 
Thanks!

That is exactly what I was looking for.

In case someone else is looking for this answer here is what I did:

strTArr = 'arr' & objRec("Category") & '(' & objRec("Item") & ')'

Eval(strTArr)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top