I have written a reporting procedure with various company code variables representing full company names. Different reports will be generated according to the company code that is plugged into the procedure. I am trying to create a ComboBox that allows the user to select the company code, which will then be used as the variable within the main procedure. I am having issues with the code recognizing the selection from the ComboBox as a string rather than the predetermined variable name.
(Company Code = Company Name)
ABC1001 = "ABC Company"
ABC1002 = "ABC, Inc."
ABC1003 = "ABC Productions, Ltd."
The ComboBox is presented to the user, allowing the user to select a company code from those available. Once the company code is selected, I have the value dropping back into the main procedure via a seperate variable called "company"
Company = ComboBox1.Value
Therefore, if the user selects ABC1001, Company = "ABC1001"
With the company code variables I was expecting to see this...
ComboBox selection returns: Company=ABC1001
Existing variable: ABC1001 = "ABC Company"
Therefore: Company = "ABC Company"
However, I am getting this instead...
Company="ABC1001" with no connection to the variable ABC1001 because of the quotations.
Is there a way to get the user's selection to load back into the main procedure without the quotations, so that it can be recognized as one of the predetermined variables rather than as a string???
Hope this makes sense. If not, let me know where I need to be more specific. Thanks!