Delete record in subform using command button

B

Bart

I have a table name "Notepad". I made a form (mainform) and insert a sub-form
using the table "Notepad". I inserted a command button on the mainform using
a wizard to delete a record on the subform, but it doesn't work.

Appreciate your help on this.
 
J

John Spencer MVP

It would help if you posted the code behind the button that is not working.

And if you are getting any error message(s) - tell us what they are.

And what do you mean by "... it doesn't work." Does that mean nothing gets
deleted, all records get deleted, the wrong record gets deleted, an error
message is generated?

If you want to delete a record on the subform, it is usually a good idea to
put the button in the subform. This doesn't work if your subform is in
datasheet mode, but in most cases you are better off if the subform is in
continuous form mode or single form mode.

Can you tell us why you think you need to delete a record from a subform using
a button on the mainform?

I usually use a custom VBA function to delete a record. I can call the
function from any button on any form or subform and delete the current record.


John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 

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