Cancel BeforeUpdate and Return To Old Value

P

PC Datasheet

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
 
P

PC Datasheet

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top