By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,358 Members | 2,811 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,358 IT Pros & Developers. It's quick & easy.

Retrieving data from a recordset

P: n/a
Hi,

Having struggled to master (or at least get to use) recordsets, and so
retrieve data without using a form, I'm stuck at a point which I feel ought
to be easy.

MsgBox Rs.Myfield (with brackets, without, with ! or .) will produce a
result, so my recordset (rs) is fine.

Now I want to choose the field through a function, so that the field name is
held in a variable, say MyVariable rather than use the fieldname itself. If
MyVariable = Myfield, how do I then get at MyField?

MsgBox Rs. & MyVariable

MyVariable = "[Rs].[" & MyVariable & "]"
MsgBox MyVariable (This produces the " as well!)

I think I have tried all combinations!!!

Thanks in advance
Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Rs.Fields(MyVariable)

"John M" <jo**@jmawer.demon.co.uk> wrote in message
news:ck*******************@news.demon.co.uk...
Hi,

Having struggled to master (or at least get to use) recordsets, and so
retrieve data without using a form, I'm stuck at a point which I feel ought to be easy.

MsgBox Rs.Myfield (with brackets, without, with ! or .) will produce a
result, so my recordset (rs) is fine.

Now I want to choose the field through a function, so that the field name is held in a variable, say MyVariable rather than use the fieldname itself. If MyVariable = Myfield, how do I then get at MyField?

MsgBox Rs. & MyVariable

MyVariable = "[Rs].[" & MyVariable & "]"
MsgBox MyVariable (This produces the " as well!)

I think I have tried all combinations!!!

Thanks in advance

Nov 13 '05 #2

P: n/a
"John M" <jo**@jmawer.demon.co.uk> wrote in message
news:ck*******************@news.demon.co.uk...
MsgBox Rs. & MyVariable

MyVariable = "[Rs].[" & MyVariable & "]"
MsgBox MyVariable (This produces the " as well!)

I think I have tried all combinations!!!

Thanks in advance


RS(MyVariable)

Bruno
Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.