Posted on January 5, 2009
1
2
3
4
5
6
7
8
9
| 'Coding Basics - How to Check whether the user pressed the Cancel Button on Input Box
Private Sub Command1_Click()
Dim str As String
str = InputBox("Press OK or Cancel")
If StrPtr(str) = 0 Then
MsgBox "The user pressed the Cancel button"
End If
End Sub |