Variable in the field name.

M

my

Hi All,

I have one question. Usually, we can get data from table
by using rst("userid") because we know the column name
userid. Now, I have a variable to hold the column name. I
want to get data value like this rst(var1). However, I got
an error message.

Thanks.
my
 
M

Manohar Kamath [MVP]

What was the error message? Make sure that the variable does not contain any
leading/trailing spaces. A better idea is to do:

rst(Trim(var1))

Also, print out the variable and see if that field exists in the resultset.
 
A

Aaron Bertrand - MVP

What is the code? What is "var1"? What does the table structure look like?
What is the error message?

In case there's any doubt, some information is better than none. :)
 

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

Members online

Forum statistics

Threads
474,266
Messages
2,571,087
Members
48,773
Latest member
Kaybee

Latest Threads

Top