I want to use a variable to define another variable, hopefully I can explain this well enough. I'm using VBA in MS Access 2010.
Lets say I have Var1, Var2, Var3, and Var4 and I start with this
Dim Var1 As String
Dim Var2 As String
Dim Var3 As String
Dim Var4 As String
Var1 = "Var"
Var2 = "4"
Var3 = "Hello"
Now I want to set the value of Var4, but I want to do it using the values of Var1 and Var2 combined to produce Var4, so instead of
Var4 = "Hello"
I want something like this to result in Var4 equaling "Hello":
Var1 & Var2 = "Hello"
I also want to compare the values of Var3 and Var4 by using Var1 and Var2
If Var1 & Var2 = Var3 Then
MsgBox ("Hello World!")
End If
What should happen in this If statement is it should compare the value of the variable Var4 with the value of Var3 and display the message box. I realize what I typed would compare the values "Var4" with "Hello" but hopefully you get the point because I'm not sure how to elaborate any better.
[edit] The link Barranka posted seems like it might do what I want. I'll see if I can figure out how to use that but I'm a really big noob at this so if anyone has an easier solution I'm still listening :)
[edit] I was going about this COMPLETELY wrong. After enough Googling, I stumbled across arrays. I was asking the wrong question because I didn't realize there was something else that would do what I need so easily.