By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,854 Members | 1,912 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,854 IT Pros & Developers. It's quick & easy.

Cancel BeforeUpdate and Return To Old Value

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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.