Ok this is probably a stupid question and not something Id want to do everyday but Ill be reusing some snippets of code a lot with a few key things changed here and there, so I was considering just making the parts that change variables... This in itself isint hard however theres 1 spot Im not sure if its possible.
Lets see if I can explain it right.... Can you make a variable that points to another variable... Im using my code numerous times but each uses a differnt variable that is set on form load
So say I have Var1 Var2 Var3 ....
Can I make a variable that would allow me to define which variable Im messing with once in the code
So in otherwords it would read like this:
But if I wanted to make a variable like: strvartmp = "strNameLvlOne"
Is there a way to substitue strvartmp into that code easily so it reads like my code above when the code is executed.
Sorry if that was unclear, its kinda hard to explain, the idea is so I can reuse that code many times with only having to mess with 1 word at the beginning instead of having to pick through the code and find each instance of a variable and change it.
Lets see if I can explain it right.... Can you make a variable that points to another variable... Im using my code numerous times but each uses a differnt variable that is set on form load
So say I have Var1 Var2 Var3 ....
Can I make a variable that would allow me to define which variable Im messing with once in the code
So in otherwords it would read like this:
Code:
strOriginalName = strNameLvlOne
strNameLvlOne = DLookup("[" & tblField1 & "]", "[" & tblName & "]", "[" & tblID & "] = 1")
Me.NameLvlOne.Caption = strNameLvlOne
But if I wanted to make a variable like: strvartmp = "strNameLvlOne"
Is there a way to substitue strvartmp into that code easily so it reads like my code above when the code is executed.
Sorry if that was unclear, its kinda hard to explain, the idea is so I can reuse that code many times with only having to mess with 1 word at the beginning instead of having to pick through the code and find each instance of a variable and change it.