- Local time
- Today, 09:28
- Joined
- Feb 19, 2002
- Messages
- 45,438
I have a bunch of arrays I want to populate from queries. Rather than writing a lot of code, I'd like to just call them Array1, Array2, Array3. What is the syntax I need to reference the instance? I'm using the code to generate a license key and rather than using a fixed array for each digit, I want to be able to have several substitutes to ensure that all characters change, year over year so the client can't figure out what digit in the license controls what option.
eval("Array" & rs!ArraySeq & "(" & rs!SeqNum) & ")") = rs!FldVal
so it ends up like:
Array8(22) = "N"
That's what I'm going to start with but I don't have much faith in it working so this is a preemptive question. In the last version, I just hard coded the arrays but I have three times as many now and it's a PITA to make sure that there are no duplicate values using the hardcoded method. With a table, I can define an index to ensure that "N" only occurs once for Array8
eval("Array" & rs!ArraySeq & "(" & rs!SeqNum) & ")") = rs!FldVal
so it ends up like:
Array8(22) = "N"
That's what I'm going to start with but I don't have much faith in it working so this is a preemptive question. In the last version, I just hard coded the arrays but I have three times as many now and it's a PITA to make sure that there are no duplicate values using the hardcoded method. With a table, I can define an index to ensure that "N" only occurs once for Array8