Delete records problem

rustyg

life enthusiast
Local time
Today, 05:35
Joined
Jun 1, 2005
Messages
22
Good evening,

I am experiencing a problem with the delete buttons I have added into my forms. I have 3 different forms that operators use, I added a delete button using the wizard on each form to delete the data if the user makes a mistake. I have allowed deletes in the form properties. My problem is that the button only works on one of the forms. I have checked the code and it is the same on all 3 forms.

The record is not deleted, all that happens is that the vertical bar down the LHS of the form flashes black, and thats about it

Private Sub Command52_Click()
On Error GoTo Err_Command52_Click


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

Exit_Command52_Click:
Exit Sub

Err_Command52_Click:
MsgBox Err.Description
Resume Exit_Command52_Click

End Sub

Any thoughts?

The only difference is that one button is called Command52 and the other one is called Delete

Russ
 
Code:
 DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70

That code is obsolete, try using

Code:
DoCmd.RunCommand acCmdDeleteRecord

However, the problem might be in naming your button Delete, try naming it something as cmdDelete instead.
 
it doesnt seem to work,

any more ideas?
 
are you getting any error message ... if yes which error number are you getting ?
 
No error message comes up, the vertical bar on the left hand side of the form flashes black for a second and thats about all that happens. The same code works on other forms.

Russ
 

Users who are viewing this thread

Back
Top Bottom