Close a form after delete a record

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello

I have a command button to delete a record, and I what that after deleting
the record that I selected, the form (that after deletng the record
transforms in a blank form) close itself.

Thanks,
JSilva
 
Hi, Joana.
I have a command button to delete a record, and I what that after deleting
the record that I selected, the form (that after deletng the record
transforms in a blank form) close itself.

If I understand your question correctly, you just want to close the form as
soon as the record is deleted. Inside the button's OnClick procedure (such
as the cmdDelete_Click( ) event) and after the line of code that deletes the
record, try this line of code:

DoCmd.Close acForm, Me.Name

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.
 
Back
Top