Question : How to delete a record from a form page.

I have a DB that on the form has a button on it labled "Undo Record" and when i open the for in design view and go to properties of that button it is mapped to an even proceedure as follows.
Private Sub Command157_Click()
On Error GoTo Err_Command157_Click


    DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70

Exit_Command157_Click:
    Exit Sub

Err_Command157_Click:
    MsgBox Err.Description
    Resume Exit_Command157_Click
   
End Sub

When i have the right record i want to remove and click the button i get and error.

"The command or action UNDO is not available now."

IS there something not right or how can i make that option available?

Answer : How to delete a record from a form page.

The clue is in the message.
This is an UNDO command not a Delete command.

Unless you need an Undo button, remove it and add a new button using the button wizard, and selct Delete Record as the action.
Random Solutions  
 
programming4us programming4us