Run Time Error 2115

R

rexirae

I have a textbox in a form called Charge and i am trying to make it to
revert to its old value if the user doesn't accept the changes.

Private Sub Charge_BeforeUpdate()
....
Code
....
If user responds does not respond with a yes then

Me.Charge.Value = Me.Charge.Value + OldCharge

This is where the error pops up...

Any ideas would be highly appreciated,
Thanks
 
M

Michel Walsh

Hi,


Me.ControlName.Undo

or

Me.ControlName.Value = Me.ControlName.OldValue



Hoping it may help,
Vanderghast, Access MVP
 
L

L White

I am using an Access 2003 project as a front-end for a SQL server. When
trying to update the database using a form, the users receive the following
error message, when selecting the next record selector button.

******************
Run-time error '2115':

The macro or function set to the BeforeUpdate or ValidationRule property for
this field is preventing Microsoft Office Access from saving the data in the
field.
********************************************************
The user can close out the form and then re-open it, which shows the data
has been updated. Obviously this is not the desired functionality.

Any ideas would be appreciated.

Thank you,
 
D

Dan Artuso

This of course begs the question:
Do you have code in the BeforeUpdate event or a validation rule?
 
L

L White

Yes, I tried DoCmd.Save and several others, but I still received the error.
I'm just getting my feet wet with VB. I switched, temporarily, to a macro as
a work around.
 

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