Using Access 2002, I'm creating a collection whose elements are derived from a table using DAO, as follows...
Set colAttachments = New Collection
Set rsReportInfo = db.OpenRecordset("tblReport", dbOpenTable)
With rsReportInfo
Do Until .EOF
colAttachments.Add !ReportName
.MoveNext
Loop
End With
The problem being when I MoveNext the element changes as well as the recordset item. It seems like element is populated ByRef instead of ByVal.
Any ideas why this is. I can use an array instead but would just prefer to use a collection.
Any advice appreciated.
Thanks
Set colAttachments = New Collection
Set rsReportInfo = db.OpenRecordset("tblReport", dbOpenTable)
With rsReportInfo
Do Until .EOF
colAttachments.Add !ReportName
.MoveNext
Loop
End With
The problem being when I MoveNext the element changes as well as the recordset item. It seems like element is populated ByRef instead of ByVal.
Any ideas why this is. I can use an array instead but would just prefer to use a collection.
Any advice appreciated.
Thanks