B
Bill Reed via AccessMonster.com
I have code at the end of the Before_Update event of an option group that
forces the user, by means of a MsgBox, to confirm his selection in the
option group. It works just fine, except that after canceling the update,
the record shows the little pencil up in the record selector, and the user
has to hit the {ESC} key to get rid of it. I have tried using SendKeys "
{ESC}" to no avail. Any suggestions? Here's the code:
strMsg = "You have selected " & strPhase & ". If this is correct, click
""OK""." & vbCrLf & _
"If this is not correct, click ""Cancel"" and try again"
strTitle = "Confirm Phase Selection"
iResponse = MsgBox(strMsg, vbOKCancel + vbDefaultButton2 + vbInformation,
strTitle)
If iResponse = 2 Then DoCmd.CancelEvent
SendKeys "{ESC}"
End Sub
forces the user, by means of a MsgBox, to confirm his selection in the
option group. It works just fine, except that after canceling the update,
the record shows the little pencil up in the record selector, and the user
has to hit the {ESC} key to get rid of it. I have tried using SendKeys "
{ESC}" to no avail. Any suggestions? Here's the code:
strMsg = "You have selected " & strPhase & ". If this is correct, click
""OK""." & vbCrLf & _
"If this is not correct, click ""Cancel"" and try again"
strTitle = "Confirm Phase Selection"
iResponse = MsgBox(strMsg, vbOKCancel + vbDefaultButton2 + vbInformation,
strTitle)
If iResponse = 2 Then DoCmd.CancelEvent
SendKeys "{ESC}"
End Sub