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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing Values In Collections

Status
Not open for further replies.

Shake412

Programmer
Apr 17, 2002
55
0
0
GB
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top