473,395 Members | 1,653 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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 1759
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: PinkGuava | last post by:
Hi, I have a T-SQL stored procedure that returns both output parameters and a recordset. How do I retrieve them in my ASP script? As far as I know, the ADO Command object can be used to retrieve...
6
by: Wojciech Wendrychowicz | last post by:
Hello to All, I'm trying to retrieve records from AS/400 in an VBA application. So, I've made an RPG program, then a stored procedure wchich calls that RPG program, and finally some VBA code to...
6
by: Dave Hopper | last post by:
Hi I am using the following SQL to retrieve a value in a list box using a unique ID held in the list box call cntID. The list box is used on an order form to list appointments that have been...
1
by: stjulian | last post by:
If inside a stored procedure, there a SELECT statement to return a recordset and another SELECT to set the value of an output parameter (as in SELECT @OutValue = Name FROM table WHERE pkid=5),...
5
by: znubbe | last post by:
Hi, I hope anyone can help me with this problem. I have a field of image type in a SQL 2000 database. I'm using this code to insert a document: Dim conn Dim rs Dim oStream
0
bmallett
by: bmallett | last post by:
First off, i would like to thank everyone for any and all help with this. That being said, I am having a problem retrieving/posting my dynamic form data. I have a form that has multiple options...
2
by: WhiteShore | last post by:
Here's my code: I'm using VB6, ADODB, and MsAccess as for the database. Using the combobox as the key to display all of records from the table. For NoProd = Prod001 has 3 records : candybar,...
9
ADezii
by: ADezii | last post by:
One question which pops up frequently here at TheScripts is: 'How do I retrieve data from a Recordset once I've created it?' One very efficient, and not that often used approach, is the GetRows()...
3
ADezii
by: ADezii | last post by:
Last Tip, we demonstrated the technique for retrieving data from a DAO Recordset, and placing it into a 2-dimensional Array using the GetRows() Method. This week, we will cover the same exact Method...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.