469,912 Members | 1,773 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,912 developers. It's quick & easy.

Retrieving data from a recordset

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
2 1520
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
"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.

Similar topics

6 posts views Thread by Wojciech Wendrychowicz | last post: by
6 posts views Thread by Dave Hopper | last post: by
1 post views Thread by Waqarahmed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.