Hi,
Does anyone know if there a way to search a collection backwards using the for…next…each. What I’d like to do is cycle through the tabledefs in db.tabledefs backwards. Here’s the code that currently is cycling through the records:
Dim db As Database
Dim tdf As TableDef
Set db = CurrentDb()
For Each tdf In db.TableDefs
If Left$(tdf.Name, 4) = “MSys” Then
‘ Don’t restore system files
ElseIf _
tdf.Name = “tblVersion” Or _
tdf.Name = “tblDigiOutput” Or _
tdf.Name = “tblGLTonnage” Or _
tdf.Name = “tblMeatInventoryWorksheet” Or _
tdf.Name = “tblRetailCutsInventoryWorksheet” Then
‘ Don’t restore temporary files or version file
Else
Me.lblStatusMessage.Caption = “Restoring ” & _
tdf.Name
Me.Repaint
DoCmd.TransferText TransferType:=acImportDelim, _
SpecificationName:=tdf.Name & _
” Import Specification”, _
TableName:=tdf.Name, _
FileName:=strPath & _
tdf.Name & _
“.txt”, _
HasFieldNames:=True
End If
Next tdf
Thanks!