Ben_Entrew
Registered User.
- Local time
- Today, 03:43
- Joined
- Dec 3, 2013
- Messages
- 177
Hi all,
I wanna export all tables beginning with NEW_TRP . Blank Tables shouldn't be exportet, therefore I tried to delete them before.
Somehow my check it the tables are blank or not doesn't work out.
It still exports me all tables of the database.
Can someone give me a hint please?
Thanks in advance.
Regards,
Ben
I wanna export all tables beginning with NEW_TRP . Blank Tables shouldn't be exportet, therefore I tried to delete them before.
Somehow my check it the tables are blank or not doesn't work out.
It still exports me all tables of the database.
Can someone give me a hint please?
Thanks in advance.
Regards,
Ben
Code:
Public Sub ExportAll()
Dim obj As AccessObject, dbs As Object
Set dbs = Application.CurrentData
For Each obj In dbs.AllTables
If obj Is Nothing Then
DoCmd.DeleteObject
Else
If Left(obj.Name, 7) = "NEW_TRP" Then
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel8, obj.Name, folderlocation & obj.Name & ".xls", -1
End If
End If
Next obj
End Sub