Is it possible to have a 'Delete' and 'Close' button on a form

S

sea_minerals

Am i able to put a buttom on a form that says Delete and one that says
Close.

So after people finish entering in details through the form they can
click on a 'Close' button.

When they want to delete a client they can press the 'Delete' button.
But have it to say "Are you sure you want to delete this entry" or
something.

Can a form also have a "Add Another Entry" on a form. They enter one,
then click that button to add another.

I know there are buttons for this, but im trying to make it extremely
basic for people to use (not many people know how to use access). It
doesn't matter if this is not possible!



Thanks for any help.
 
G

Guest

not many people know how to use access ?????
________________________

So after people finish entering in details through the form they can
click on a 'Close' button.

Private Sub ButtonName_Click()
DoCmd.Close
End Sub

________________________
When they want to delete a client they can press the 'Delete' button.
But have it to say "Are you sure you want to delete this entry" or
something.

Private Sub ButtonName_Click()
Msg = "Are you sure you want to delete this record?"
Style = vbYesNo
title = "Record Delete"
responce = MsgBox(Msg, Style, title)
If responce = vbYes Then
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
End If
End Sub

________________________
Can a form also have a "Add Another Entry" on a form. They enter one,
then click that button to add another.

Private Sub ButtonName_Click()
DoCmd.GoToRecord , , acNewRec
End Sub
 
P

Pieter Wijnen

"Better" is - At least turning off & on the warnings to avoid 2 confirmation
questions <g>

Private Sub ButtonName_Click()
If MsgBox ("Are you sure you want to delete this record?", vbYesNo +
vbQuestion, "Record Delete") = vbYes Then
DoCmd.SetWarnings False
DoCmd.RunCmd acCmdDeleteRecord

DoCmd.SetWarnings True
End If
End Sub

HTH

Pieter
 

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