469,908 Members | 2,212 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,908 developers. It's quick & easy.

Cancel BeforeUpdate and Return To Old Value

In a form/subform I have an unbound combobox in the form header that sets
the value of a field in the subform so that it does not have to be entered
for each record. In the BeforeUpdate event of the combobox I have some code
to check the value against some criteria and if the new selected value fails
the criteria, I cancel the BeforeUpdate event. I need the combobox to return
to its previous value. For example, the current value is MyValue and the new
selected value is NewValue. When the BeforeUpdate event is cancelled, I want
the combobox to return to MyValue. I have tried undoing the combobox and
undoing the form but the combobox continues to display NewValue. If I go to
another record and return back, MyValue is correctly displayed. So how do I
get the combobox to return to MyValue as soon as the BeforeUpdate event is
cancelled?

Thanks for all help!

Steve
Nov 13 '05 #1
2 13964
From October 20, 2005:

http://groups.google.com/group/micro...4a75d8d15ba513

--

Ken Snell
<MS ACCESS MVP>
"PC Datasheet" <no****@nospam.spam> wrote in message
news:F8*******************@newsread2.news.atl.eart hlink.net...
In a form/subform I have an unbound combobox in the form header that sets
the value of a field in the subform so that it does not have to be entered
for each record. In the BeforeUpdate event of the combobox I have some
code to check the value against some criteria and if the new selected
value fails the criteria, I cancel the BeforeUpdate event. I need the
combobox to return to its previous value. For example, the current value
is MyValue and the new selected value is NewValue. When the BeforeUpdate
event is cancelled, I want the combobox to return to MyValue. I have tried
undoing the combobox and undoing the form but the combobox continues to
display NewValue. If I go to another record and return back, MyValue is
correctly displayed. So how do I get the combobox to return to MyValue as
soon as the BeforeUpdate event is cancelled?

Thanks for all help!

Steve

Nov 13 '05 #2
So Undo does not work on unbound controls? I didn't know that but I haven't
used Undo much. One learns something every day.

Thanks, Ken!

Steve
"Ken Snell [MVP]" <kt***********@ncoomcastt.renaetl> wrote in message
news:eB**************@TK2MSFTNGP09.phx.gbl...
From October 20, 2005:

http://groups.google.com/group/micro...4a75d8d15ba513

--

Ken Snell
<MS ACCESS MVP>
"PC Datasheet" <no****@nospam.spam> wrote in message
news:F8*******************@newsread2.news.atl.eart hlink.net...
In a form/subform I have an unbound combobox in the form header that sets
the value of a field in the subform so that it does not have to be
entered for each record. In the BeforeUpdate event of the combobox I have
some code to check the value against some criteria and if the new
selected value fails the criteria, I cancel the BeforeUpdate event. I
need the combobox to return to its previous value. For example, the
current value is MyValue and the new selected value is NewValue. When the
BeforeUpdate event is cancelled, I want the combobox to return to
MyValue. I have tried undoing the combobox and undoing the form but the
combobox continues to display NewValue. If I go to another record and
return back, MyValue is correctly displayed. So how do I get the combobox
to return to MyValue as soon as the BeforeUpdate event is cancelled?

Thanks for all help!

Steve


Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Corrine | last post: by
4 posts views Thread by bob bob via AccessMonster.com | last post: by
1 post views Thread by Waqarahmed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.