Deleting Records with VBA in Form

  • Thread starter Thread starter Matthew de Rouville
  • Start date Start date
M

Matthew de Rouville

I'm using Microsoft Access 2002 and writing a VBA script.

There a form property called AllowDeletions that allows the used to delete
records when using a form. (When set to "No", a user cannot delete
records.) However, the help does not tell you how to actually delete the
records. IS there a VBA command that will delete the current record?

I have used a opened a Recordset and then used the Delete command, but that
leaves a deleted record that I can move to in the form, and that causes
problems.

Thanks for any help.

Matt
 
Matthew,
Regarding:
IS there a VBA command that will delete the current record? <

Display the record on the form.
If you don't have the Delete tool button, then use

DoCmd.RunCommand acCmdDeleteRecord

in a Command button event.
 
Fred

Thanks--that did the trick!

Now, is there a way to turn of the dialog box that comes up when you delete
a record?
Thanks.
Matt
 
Never mind. I found

DoCmd.SetWarnings False

to turn off the delete record dialog.
 
Back
Top