Delete Query on Forms

L

landisls

I cannot seem to add a command button on a form that supports the Delete
Query function. Is this possible?
 
K

Ken Snell [MVP]

The Delete Query function? You mean you want to run a delete query by
clicking a button on the form?

Assuming that this is indeed what you want to do, use code similar to this
for the Click event of the button:

Private Sub CommandButtonName_Click()
DoCmd.SetWarnings False
DoCmd.OpenQuery "DeleteQueryName"
DoCmd.SetWarnings True
End Sub
 
L

landisls

Thanks so much!

Ken Snell said:
The Delete Query function? You mean you want to run a delete query by
clicking a button on the form?

Assuming that this is indeed what you want to do, use code similar to this
for the Click event of the button:

Private Sub CommandButtonName_Click()
DoCmd.SetWarnings False
DoCmd.OpenQuery "DeleteQueryName"
DoCmd.SetWarnings True
End Sub
 
Top