Delete record in a linked database

G

Guest

Hello,

I had a form linked to a table that contained a delete button that allowed
the user to delete the current record.

Eventually I wound up splitting the database so multiple users can use the
database and now my delete button does not work.

Any suggestions on how to fix the problem.
 
J

Jeff Boyce

Sean

No info about what happens when you try. Nothing? Error message?
Something else gets deleted?

More info, please

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
M

Majic

Hello,

I had a form linked to a table that contained a delete button that allowed
the user to delete the current record.

Eventually I wound up splitting the database so multiple users can use the
database and now my delete button does not work.

Any suggestions on how to fix the problem.

You need to double click on delete button (in the front end of the
database) and go to event and select on click and place the following
code in there:
Make sure that name of the field matches "cmdDelete" or you need to
change it.

Private Sub cmdDelete_Click()
On Error GoTo Err_cmdDelete_Click


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

Exit_cmdDelete_Click:
Exit Sub

Err_cmdDelete_Click:
MsgBox Err.Description
Resume Exit_cmdDelete_Click

End Sub
 
G

Guest

Nothing Happens. I created the delete command button using the wizard and
tried recreating the button and still nothing happens.
 
G

Guest

That is the code that was created when I used the wizard to create the delete
box. I looked it over and the code has not changed but it still does not
work. Any other thoughts?
 
J

Jeff Boyce

Sean

Open the (first) form in design view. Highlight the command button you've
created and select Properties. Get into the code behind the OnClick event.
Add in a breakpoint and/or a message box that you will use to make sure that
Access is "seeing" your click.

Save changes.

Try again. If your code doesn't break (or the messagebox doesn't pop up),
Access is not interpreting what you are doing as a button click.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top