On my form, I have a button that, when clicked, has an if structure in it:
If MsgBox(strMsg, vbYesNoCancel, "Warning!") = vbYes Then
Forms![Changes Pending].SetFocus
Exit Sub
ElseIf MsgBox(strMsg, vbYesNoCancel, "Warning!") = vbNo Then
stDocName = "QRY Add Revision Data"
[DoCmd.OpenQuery] 'basically opens a query
Exit Sub
ElseIf MsgBox(strMsg, vbYesNoCancel, "Warning!") = vbCancel Then
Exit Sub
End If
My problem is that upon clicking a no or a cancel in the MSGBOX the first time, nothing happens. The msgbox just flashes and comes back. If I click three times, the action takes place. (No, runs my query; Cancel, exits the sub).
It's not looped, anybody know why it does this?
thanx
[This message has been edited by wrekless (edited 07-17-2000).]
[This message has been edited by wrekless (edited 07-17-2000).]
If MsgBox(strMsg, vbYesNoCancel, "Warning!") = vbYes Then
Forms![Changes Pending].SetFocus
Exit Sub
ElseIf MsgBox(strMsg, vbYesNoCancel, "Warning!") = vbNo Then
stDocName = "QRY Add Revision Data"
[DoCmd.OpenQuery] 'basically opens a query
Exit Sub
ElseIf MsgBox(strMsg, vbYesNoCancel, "Warning!") = vbCancel Then
Exit Sub
End If
My problem is that upon clicking a no or a cancel in the MSGBOX the first time, nothing happens. The msgbox just flashes and comes back. If I click three times, the action takes place. (No, runs my query; Cancel, exits the sub).
It's not looped, anybody know why it does this?
thanx
[This message has been edited by wrekless (edited 07-17-2000).]
[This message has been edited by wrekless (edited 07-17-2000).]