I have a form where i display results from a query, with buttons in the header, one of the buttons is "delete all" which is supposed to be deleting all the records in the query.
I have a problem with this and it seems to be because it is displayd in the form by continous forms.
here is the code:
I have a problem with this and it seems to be because it is displayd in the form by continous forms.
here is the code:
Code:
Private Sub Kommando19_Click()
Dim strMsg As String
Dim strSql As String
strMsg = "Du er i ferd med å slette alle de valgte elementene" + vbCrLf + vbCrLf
strMsg = strMsg + "Fortsette?"
If MsgBox(strMsg, vbQuestion + vbYesNo, "Slette?") = vbYes Then
strSql = "DELETE Query1. * FROM Query1"
CurrentDb.Execute strSql
End If
End Sub