vba inputBox: How to tell difference between “cancel” and “OK” with an empty textbox
问题 A vba inputBox returns an empty string when the cancel button is pressed. When OK is pressed, it returns whatever text is in its textbox. The inputBox's third positional argument is the initial text in its textbox. The default value for this argument is "". In my application, I use an inputBox to ask a user to specify the name for a new record when he clicks an "Add Record" button. If he presses "cancel", no problem: seems he changed his mind about that new record. I exit the sub. However, if