Hello, I have a small form with a txtbox and a command button for deleting records from a table, it works well but I want to add a reset phrase so the txtbox will clear after the delete and refresh the form, the code behind the button is
Sub Command0_Click()
On Error GoTo Err_cmdDelete_Click
Dim SQL_Text As String
SQL_Text = "Delete * from Equipment WHERE DemoID = Forms!frmDelete!TxtDemoID"
DoCmd****nSQL (SQL_Text), acEdit
Exit_cmdDelete_Click:
Exit Sub
cmdDelete_Error:
Select Case Err.Number
Case 3059
MsgBox "You have canceled the delete operation.", vbOKOnly, "Delete Canceled"
Exit Sub
Case Else
MsgBox "Error number: " & Err.Number & " has occurred. " & Err.Description, vbOKOnly, "Error"
End Select
Err_cmdDelete_Click:
MsgBox Err.Description
Resume Exit_cmdDelete_Click
End Sub
works well, it's at the bottom of this I would like to add the reset and refresh code.
Dim intIndex As Integer
Me.TxtDemoID = ""
Me.Refresh
This last bit work behind a button all by itself.
Any help is appreciated

Sub Command0_Click()
On Error GoTo Err_cmdDelete_Click
Dim SQL_Text As String
SQL_Text = "Delete * from Equipment WHERE DemoID = Forms!frmDelete!TxtDemoID"
DoCmd****nSQL (SQL_Text), acEdit
Exit_cmdDelete_Click:
Exit Sub
cmdDelete_Error:
Select Case Err.Number
Case 3059
MsgBox "You have canceled the delete operation.", vbOKOnly, "Delete Canceled"
Exit Sub
Case Else
MsgBox "Error number: " & Err.Number & " has occurred. " & Err.Description, vbOKOnly, "Error"
End Select
Err_cmdDelete_Click:
MsgBox Err.Description
Resume Exit_cmdDelete_Click
End Sub
works well, it's at the bottom of this I would like to add the reset and refresh code.
Dim intIndex As Integer
Me.TxtDemoID = ""
Me.Refresh
This last bit work behind a button all by itself.
Any help is appreciated
