Hi and thanks for all help.

How to erase a file

   file.Delete (App.Path & "\backup\PhoneTel.mdb")

it do not work.

Or do like this instead that the file phonetel.mdb
is uppdating evry time you press enter.

Recommended Answers

All 2 Replies

verify that app.path returns what you think it does. Also the file can not be open by some other procesas.

Try :

 Private Sub Command2_Click()
     Kill (App.Path & "\backup\PhoneTel.mdb")
 End Sub

Or you can do like this :

Private Sub filedelete(filename As String)
    Dim filesystemobject As Object
    Set filesystemobject = CreateObject("Scripting.filesystemobject")
    filesystemobject.deletefile filename, True
End Sub

Private Sub Command2_Click()
    filedelete (App.Path & "\backup\PhoneTel.mdb")
End Sub
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.