Unable to Delete a Record



I have a command button on a form that is supposed to Delete the record
being displayed. The record is displayed one to a form. The form is
not a Pop-Up nor is it Modal. Tracing the btnDelete event routine shows
that AllowDeletions is TRUE.

When the Delete button is clicked (without TRACE ON), I get a 'beep',
the recordselector (vertical bar on left of form) gets dark in color,
but the record is not deleted. Also, there is no error message that
pops up.

HOWEVER, when I trace the routine ...

Private Sub btnDelete_Click()
On Error GoTo Err_btnDelete_Click

DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70

Exit_btnDelete_Click:
Exit Sub

Err_btnDelete_Click:
Call ShowError("frmPeople", "btnDelete_Click", Err.Number,
Err.Description)
Resume Exit_btnDelete_Click

End Sub

When the first DoCmd is executed I get an error that displays from the
error displaying routine ShowError. The error says:

"The command or action 'Select Record' isn't available now"

I've looked around in the database options to see if I have something
set somewhere to prevent Deletions. I can't find anything.

This error happens for two tables using different forms, but the same
logic structure (delete command button with the same DoCmd
instructions).

HELP. I thought that I was so close to finishing this project. Now I'm
stumped again.

Thanks.

Regards,
SueB

*** Sent via Developersdex http://www.developersdex.com ***
.



Relevant Pages

  • Re: Call statements
    ... A command button event may have specific code and calls to other routines. ... a routine that does the real work. ... Private Sub btnCTemp_Click ... dim dblFTemp as double ...
    (microsoft.public.vb.general.discussion)
  • Re: Unable to Delete a Record
    ... What this does is to undo any edits in progress: an undo or save has to ... Tracing the btnDelete event routine shows ... > Exit Sub ... > error displaying routine ShowError. ...
    (comp.databases.ms-access)
  • Re: cmdFind_Click
    ... being thrown back out to the cboFindMatl_Clickroutine. ... > It's a command button, ... > End Sub ... > Private Sub cmbFindMatl_Click ...
    (microsoft.public.vb.general.discussion)
  • Re: OnTime Method fails when Form displayed???
    ... > Ontime command is triggered. ... Displaying a modal form counts as busy in ... > Keep your VBA code safe, ... >> Private Sub CommandButton1_Click ...
    (microsoft.public.word.vba.userforms)
  • "The command or action xxxxxx is not available now" Error
    ... "The command or action 'DeleteRecord' isn't available now." ... The routine that gets the error is (comments left in to show various ... Private Sub btnDelete_Click ...
    (comp.databases.ms-access)