Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

write data from access query to excel worksheet

Status
Not open for further replies.

dayandow4

Programmer
Jun 23, 2011
1
US
I am trying to copy data from a query in my database to an excel sheet can anyone tell me why this is not working:



Set rst2 = CurrentDb.OpenRecordset("qryXXXX")

Do Until rst2.EOF
Set workSheet = appExcel.Worksheets("DataSheet" & i)
workSheet.Cells(rst2![CellRow], rst2![CellColumn]).Value = rst2![Value] '******
rst2.MoveNext
Loop

the code bombs on the line with the **** after it and it tells me error: "item not found in this collection"


Thanks ahead of time
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top