Delete a file : Kill « File Path « VBA / Excel / Access / Word






Delete a file

 
Sub CompactRepairDB()
    Dim strFilePath As String

    strFilePath = CurrentProject.Path

    If Len(Dir(strFilePath & "\Small.mdb")) Then
        Kill strFilePath & "\Small.mdb"
    End If
End Sub

 








Related examples in the same category

1.Error trap