ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Start copying an access recordset starting with the next column (https://www.excelbanter.com/excel-programming/431219-start-copying-access-recordset-starting-next-column.html)

gab1972

Start copying an access recordset starting with the next column
 
I am bringing information from a recordset into Excel. I want to
start copying the recordset data starting with column two. Column one
is my primary key identifier and I don't want that. I'm thinking it
has something to do with .Fields???

'Copy the matched recordset into the worksheet starting at column "AN"
With wsSheet1
.Cells(2, 40).CopyFromRecordset rs2.Fields(2,?????) <----
this is where I am unsure
End With
'Close connections with permit_life
rs2.Close

Tim Williams[_2_]

Start copying an access recordset starting with the next column
 
Couldn't you just exclude the PK column from the select ?

Tim

"gab1972" wrote in message
...
I am bringing information from a recordset into Excel. I want to
start copying the recordset data starting with column two. Column one
is my primary key identifier and I don't want that. I'm thinking it
has something to do with .Fields???

'Copy the matched recordset into the worksheet starting at column "AN"
With wsSheet1
.Cells(2, 40).CopyFromRecordset rs2.Fields(2,?????) <----
this is where I am unsure
End With
'Close connections with permit_life
rs2.Close





All times are GMT +1. The time now is 02:51 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com