Courtesy of EE Access, I have a piece of code which should check to see if an access table exists, if it does then it deletes it.
Unfortunately I keep getting an error - User defined type not defined (it highlights the line ... Dim td As DAO.TableDef)
The code is below, can anybody help?
Private Function UpdateTables_Click()
'Test for tables
Dim td As DAO.TableDef
On Error Resume Next
Set td = CurrentDb.TableDefs("Dbo_AppointmentsView")
If Err = 0 Then DoCmd.DeleteObject acTable, "Dbo_AppointmentsView"
Set td = CurrentDb.TableDefs("dbo_AssignmentFeeAllocationsView")
If Err = 0 Then DoCmd.DeleteObject acTable, "dbo_AssignmentFeeAllocationsView"
'next table etc etc