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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How Can I build a user confirmation in my action?

Status
Not open for further replies.

SheilaAlighieri

Technical User
Nov 16, 2002
68
NL
Hi,

I would like to get a user confirmation before subjoined action takes place. I was thinking about using a message box: Call MsgBox("Replace?", vbOKCancel).

But I don't know where to go from there.. :(

Private Sub Button__Add__Click()

Call MsgBox("Replace?", vbOKCancel)

If Me!txtReplace <= Me!txtBudget Then
Me!txtBudget = Me!txtBudget - Me!txtReplace
Me!txtPlanned = Me!txtPlanned + Me!txtReplace
Me!txtReplace = Null

Else
Call MsgBox(&quot;Please choose a value less or equal to the budget.&quot;)
End If

End Sub

One more thing, I would like to show the contents of a text box 'txtReplace' to be shown in my messagebox. Do I have to use a string of some sort?

:)

Sheila
 
Do Something like this:
Code:
    If (MsgBox(&quot;replace: &quot; & txtReplace, vbOKCancel) = vbOK) Then
       Do what you want here when they press OK
    else
       Do what you want here when they press Cancel
    End IF
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top