Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form button with protection 1

Status
Not open for further replies.

molly

Technical User
Jul 17, 2000
219
US
I have a fully working Button on a form using the "On Click". However, I would like to have a confirmation question asking me if I want to proceed. How do?
thanks so much.

Private Sub Command624_Click()

DoCmd.OpenQuery "8157QrySpecificMoveToHistory"
DoCmd.Maximize
Me.Refresh

End Sub
 
look at the msgbox function. I returns a value that you then can check with an "if then" statement.
 
How are ya molly . . .

Example [blue]MsgBox[/blue]:
Code:
[blue]   Dim Msg As String, Style As Integer, Title As String, DL As String

   DL = vbNewline & vbNewline

   Msg = "Do you wish to proceed!" & DL & _
         "Click 'Yes' to proceed!" & DL & _
         "Click 'No' to cancel."
   Style = vbQuestion + vbYesNo
   Title = "Proceed Confirmation! . . ."
   
   If [purple][b]MsgBox(Msg, Style, Title) = vbYes[/b][/purple] Then
      DoCmd.OpenQuery "8157QrySpecificMoveToHistory"
      DoCmd.Maximize
      Me.Refresh
   End If[/blue]

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
Thanks Aceman. It works perfectly. I now have double precaution on my Update qry. i didn't want to use a password. just wanted a gentle method to make my person stop before continuing.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top