Hello,
I have a userform with some textboxes and command buttons (one of them, "cmdClose")
I need to code the following scenario
If I click "cmdClose" and the textamount is greater than Zero, pop up msgbox with vbYesNo, if I click Yes, close the userform, else, do nothing
And if txtamount is Zero or null, close the userform without msgbox
I have the following code that works if the txtamount is greater than Zero, but if txtAmount is empty it does nothing
I have a userform with some textboxes and command buttons (one of them, "cmdClose")
I need to code the following scenario
If I click "cmdClose" and the textamount is greater than Zero, pop up msgbox with vbYesNo, if I click Yes, close the userform, else, do nothing
And if txtamount is Zero or null, close the userform without msgbox
I have the following code that works if the txtamount is greater than Zero, but if txtAmount is empty it does nothing
Code:
Private Sub cmdClose_Click()
If Me.txtAmount.Value > 0 Then
result = MsgBox("Are you sure?", vbYesNo + vbCritical, "Closing POS")
If result = vbYes Then
Unload Me
Else
End If
End If
End Sub