Access Run-Time Error 2115 only on newer version of Access??

B

beachffl

I have a database that works completely fine in Access XP, but when ran
on the newer version of Access 2003 I get the following error... has
anyone seen this before?

******************
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.
********************************************************

Here is the code behind the error.

Private Sub Gate2_BeforeUpdate(Cancel As Integer)
Dim strSQL As String

'clear all other gate 2 markers before the update
strSQL = "UPDATE tdChange SET Gate2=0 WHERE PartID=" &
intCurrentPartID & " AND ChangeID<>" & intCurrentChangeID & ";"
DoCmd.SetWarnings (0)
DoCmd.RunSQL strSQL
DoCmd.SetWarnings (1)

Refresh

End Sub
 
R

René François

Hi!

What do you try to refresh?

Usually the syntax is like: MyRecordset.Refresh or MyForm.refresh or
Me.Refresh

I may be wrong but I'm not sure that Refresh is anything but a method you
apply to an object.
 
T

Terry

I have had this recently and traced it to the way I had designed my forms,
i.e. main form / subform. The subform recordsource is based on the same
recordsource as the mainform. If I saved something to the subforms
underlying dataset and then tried to do something in the mainform I got the
2115 information message.

Took me sometime to figure out what was causing it. The fix for me was to
requery the subform and mainform after writing anything to either forms
dataset. Requery ensures any changes are written.

Regards

Terry
 

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