Changeing a Recordset Name With a Variable?
Hey i'm working on this form that fills a spreadsheet with info from a crosstab query, and i need a the recordset name to change as o loop though the table
Do Until intCount = intColCount
Set rstCheck = CurrentDb.OpenRecordset("Select * from qryJobOffersByYearCount where activeyear = " & intYearCount)
If rstCheck.RecordCount > 0 Then
Set rst = CurrentDb.OpenRecordset("Select * from qryJobOffersByYearCountCrosstab")
If rst.RecordCount > 0 Then
rst.MoveFirst
introwcount = 2
Do Until rst.EOF
objTimesheet.cells(introwcount, intCount) = rst![intYearCount]
introwcount = introwcount + 1
rst.MoveNext
Loop
intCount = intCount + 1
End If
End If
intYearCount = intYearCount + 1
Loop
------
objTimesheet.cells(introwcount, intCount) = rst![intYearCount]
i need this to change evey time its loops
for example i have these years
2003
2005
2006
2007
so as it gose though i need
objTimesheet.cells(introwcount, intCount) = rst![2003] and so on
i hope this makes sense
|