help with delete?

  • Thread starter Thread starter Allen
  • Start date Start date
A

Allen

I have a form were it only generates one record no more.
I have 2 buttoms on this form "Finish" and "Cancle". when
one of them is clicked, I want to delete the record. I
have it deleting now, with the menu action, but I don't
want to verify yes for deleting, I just want it to delete
no questions asked, you know what I mean. and the undo
command will not work for me here, I just need it to
delete. Is there another way of doing it instead of using
the menu action?

Thanks Allen
 
Hy,

you can use a query or stop showing warnings:

1. Well, for query:

CurrentDb.Execute "DELETE * FROM table WHERE cond"

table has to be the name of the table which contains the record. cond
describes the condition which chooses the correct record. if the table
consists only of one record you can leave away the WHERE-clause.

2. Use DoCmd.SetWarnings false to stop showing the questing before you use
the DoCmd.DoMenuItem or the RunCommand-call to delete the record. After that
call you should use DoCmd.SetWarnings true to activate warnings.

Bye

Lars
 
Back
Top