Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

a rather strange occurence

Status
Not open for further replies.

jgoodman00

Programmer
Jan 23, 2001
1,510
I have the following procedure running in the before_update event of several forms. In all but one it works perfectly. However, on one particular form it errors, stating that 'Update or CancelUpdate without AddNew or Edit'. This seems a little strange, because I have only seen this error applying to DAO manipulation (where you have to set a recordset to edit or add). However, I am simply trying to assign a couple of variables to a couple of controls. This is simple, but on this one form will not work.

Private Sub Form_BeforeUpdate(Cancel As Integer)
If Me.Dirty Then
If MsgBox("The record has been changed, would you like to save the changes?", vbYesNoCancel) = vbYes Then
Me.ModUser = Environ("UserName")
Me.ModDate = Now
Else
Me.Undo
End If
End If
End Sub


Has anybody else had this error, when not using DAO? I am thinking it is something to do with the form properties, but the obvious properties seem ok (such as AllowEdits etc).

James Goodman
 
Dear James,

AFAIK in fact access uses DAO in background for its own executions.

HTH

regards Astrid

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top