AHHH!!! i can create custom objects and collections in Access2002 but i can't get the For...Each to work. i get the "Object doesn't support this method or property" when i use For Each on the collection. This is the code:

Public Function FoxProToAccess(ByRef FileCol As colfiles, ByRef Version As AccessVersion) As Boolean
Dim FileObj As clsfile
Dim FoxProFileName As String

For Each FileObj In FileCol
If Len(FileObj.FileName) > 8 Then
FileToDOS8 FileObj
FoxProFileName = FileObj.FileName
End If

DoCmd.TransferDatabase acImport, "dBase IV", FileObj.FileName, acTable, FileObj.FileName, FileObj.DestinationName

Next FileObj
End Function

i'm very familiar with VB and VBA and have used collections often in VB. But in VB, you need to add the following proc to enable For Each on custom collections:

Public Function NewEnum() As IUnknown
Set NewEnum = mcolFiles.[_NewEnum]
End Function

THEN you need to set the collection class's UserMemID to -4. (This is a menu option in VB)

i added the NewEnum function but there is no similar menu option in Access for the UserMemID and i'm guessing this is the problem i'm having.

Any ideas? i've searched the internet for days and have come up with nothing.