refer to constant in code

  • Thread starter Thread starter smk23
  • Start date Start date
S

smk23

Within a function, I need to change the constant I am using in a statement
based on a passed-in string value. For example, I pass in the string value

"pqPartyPhone"

and the constant I need to use is

cstrpqPartyPhone

How can I do this?
 
smk23 said:
Within a function, I need to change the constant I am using in a statement
based on a passed-in string value. For example, I pass in the string value

"pqPartyPhone"

and the constant I need to use is

cstrpqPartyPhone

How can I do this?

Use a Select Case statement, something like:

Select Case PassedInValue
Case "pqPartyPhone"
variable = cstrpqPartyPhone
Case "something"
variable = cstrSomething
Case Else
variable = cstrSomethingElse
End Select
 
Back
Top