kingJams
01-23-2006, 03:26 PM
I would like to use code to delete the text from a text box after saving the text. I have managed to get the save function to work but can't seem to get delete to work. The name of my text box is txtEnter. The name of the button to do both function is cmdSave. The delete code is:
Private Sub cmdDel_GotFocus()
On Error GoTo Err_cmdDel_Click
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
txtEnter.Text = "Text"
Exit_cmdDel_Click:
Exit Sub
Err_cmdDel_Click:
MsgBox Err.Description
Resume Exit_cmdDel_Click
End Sub
Private Sub cmdDel_GotFocus()
On Error GoTo Err_cmdDel_Click
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
txtEnter.Text = "Text"
Exit_cmdDel_Click:
Exit Sub
Err_cmdDel_Click:
MsgBox Err.Description
Resume Exit_cmdDel_Click
End Sub