This is probably an easy one for you experts out there...I am trying to assign a value to a variable after selecting the right variable name based on the values in a database query. I have about 200 variable names that I need to populate so I was hoping to assign their values dynamically. I can't seem to find the right syntax or method, but I am trying to do something like this:
the variable format is: category_month_color
R("prod_category") & "_" & R("month") & "_color = "#0000FF"
OR
R("prod_category")_R("month")_color = "#0000FF"
I get invalid character errors. Here is a more complete example:
dim cat1_january_color
dim cat2_january_color
dim cat1_february_color
dim cat2_february_color
dim cat1_march_color
dim cat2_march_color
...etc.
SELECT status, prod_category, month from products
While not R.EOF
If R("status") = "sold" Then
R("prod_category") & "_" & R("month") & "_color = "#0000FF"
Else
R("prod_category") & "_" & R("month") & "_color = "#CCBBFF"
End If
R.MoveNext
Wend
Thanks in advance for your time! : )
Kenrette