yes/no button confirmation

  • Thread starter Edgar Chado via AccessMonster.com
  • Start date
E

Edgar Chado via AccessMonster.com

I have found another way to do this which I fond more easy to use by the
users. I am using a search form which filters the records by date and
depending on the date it will let me edit the record or not.

By the way, I want to put a yes/no button which will let me display a
message box before puting its status to ok.

Up till now I have this code in the on click event,

Private Sub Anulado_Click()
Beep
If MsgBox("Est? seguro que quiere anular el pedido N?" & Me.N?_de_Pedido &
"?", vbQuestion + vbYesNo, "Anular el pedido?") = vbYes Then
End If
End Sub

What I am missing is the THEN section. I dont know what to put so it sets
the value of the yes/no option to yes if the users press enter on the
message box or leave it blank, I they cancel the action.
 
R

Rob Parker

Assuming that Anulado is the name of a field with a Yes/No datatype:

If MsgBox..... Then Me.Anulado = True

This will set the field to Yes (True) if the user clicks Yes in the
message-box; it will be unchanged if the user clicks No or just closes the
message-box.

Note that for a one-line If... Then statement you can put this all on a
single line, and omit the End If

HTH,

Rob
 
E

Edgar Chado via AccessMonster.com

Rob,

Thank you very much for your help.

It is working!!!!
 

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

Similar Threads

Delete button not "deleting" ??? 3
yes/no Code 1
yes no user promt 9
Auto date changes on continues forms 6
Yes or No key confirmation 5
Data in Mainform and Subform 3
Not on list event 1
Beep in a MsgBox 2

Top