DKDiveDude
Registered User.
- Local time
- Today, 11:38
- Joined
- Mar 28, 2003
- Messages
- 56
Is there any way to to create a variable with the name of another variables content in VBA?
PHP has something like what I now need in VBA, I believe it is something like this:
// Put text string in a variable
$Fruit="Apple";
// Now create a variable named as the content of the above variable and put content in the new variable
$$Fruit=5;
// Print the content of $Apple which should now contan 5
echo $Apple;
Of course to be of real value the newly created variable should be available globally, another thing I don't know if MS Accces can do, unless defined in a module.
Alternatively I would need something like being able to define an array of names and then assign a number to each name, like this:
Dim Fruit
Fruit = Array("Apples", "Bananas", "Oranges")
and then later do this:
Fruit("Apples")=5
PHP has something like what I now need in VBA, I believe it is something like this:
// Put text string in a variable
$Fruit="Apple";
// Now create a variable named as the content of the above variable and put content in the new variable
$$Fruit=5;
// Print the content of $Apple which should now contan 5
echo $Apple;
Of course to be of real value the newly created variable should be available globally, another thing I don't know if MS Accces can do, unless defined in a module.
Alternatively I would need something like being able to define an array of names and then assign a number to each name, like this:
Dim Fruit
Fruit = Array("Apples", "Bananas", "Oranges")
and then later do this:
Fruit("Apples")=5