Patrick O'Dea
asked on
Access VBA Simple "undo" question
See my VBA which does a msgbox "beforeupdate".
Question: If I click "cancel" in the msgbox WHY does it NOT undo the change I made to the control IFGYesNocmb. Do I need to do some thing else??
Question: If I click "cancel" in the msgbox WHY does it NOT undo the change I made to the control IFGYesNocmb. Do I need to do some thing else??
Private Sub IFGYesNocmb_BeforeUpdate(Cancel As Integer)
If MsgBox("Confirm This Change to IFG Status", vbOKCancel, _
"OK Or Cancel") <> vbOK Then
Me.IFGYesNocmb.Undo
Exit Sub
End If
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
folks, I tried the "Cancel=True" but no joy.
See attached frmMain. Perhaps because it is a "combo" or perhaps the continuous form causes a complication.
See 20 second video
http://screencast.com/t/lii9Pl7LDwyT
IFG1.accdb
See attached frmMain. Perhaps because it is a "combo" or perhaps the continuous form causes a complication.
See 20 second video
http://screencast.com/t/lii9Pl7LDwyT
IFG1.accdb
ASKER
Thanks Pat,
That's it!
That's it!
I don't quite follow. Seems my code was the solution, with Pat's explanation being followup, so I'm not clear on the point award. Can you please explain why you awarded points in that manner?
ASKER
Sorry Scott , I mis read the comments.
How can I re-allocate points?
How can I re-allocate points?
You can ask the Mods to reopen the question. Just use the Request Attention link at the top of your question, just below the original text.
ASKER
Thanks,
All working well.
All working well.
I think you can remove the UNDO line and simply use Scott's line:
If MsgBox("Confirm This Change to IFG Status", vbOKCancel, _
"OK Or Cancel") <> vbOK Then
Cancel = True
End If