Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 811
Default Promlems with DAO


Try:

Cells(1,1) = RS1.Fields(FieldName)

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *


"djEsko" wrote in message
...
I'm trying to get some data from Access database. The code is following.

Set RS1=DB1.OpenRecordset("SELECT * FROM TestTable")
Do Until RS1.EOF
Cells(1,1)=RS1!Field1
RS1.MoveNext
Loop

Instead on RS1!Field1 I would like to use a variable, which has the name

of
the field.

E.g.
FieldName="Field1"
Cells(1,1)=RS1! & Field <- This is not working.

Any ideas?



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:25 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"