converting a string to a variable name

B

Brian Rypstra

Could someone please tell me how I can convert a string to a variable name
as in

dim str, var1
str = "var1"
now I want to be able to set the value of str to point to var1
so that I can change the value of var1 by the following:

function(str) = 6 such that now
?var1 = 6
The reason for this is I want to be able to set a previously defined
public variable to the value of field related to a field's value having the
same name as the variable (allbeit a string)

When I use the openrecordset & recordset!Field I get a string which I want
to use to set the variable having the same name.

Thanks in advance
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top