Connecting Tech Pros Worldwide Forums | Help | Site Map

Update or CancelUpdate without AddNew or Edit Error on code run.

crispywafers@yahoo.com
Guest
 
Posts: n/a
#1: Nov 13 '05
Hi,

Hope someone can help me out. I have a piece of code I use to update a
subforms numbers (Trimester Invoices) if the mainform numbers (School
Year Order) change.

What is interesting is the code works if I type numbers into the
mainform once, but if you accidently mistype something and go back
immediately to reenter the number into the same field you get this
"update or cancelupdate without addnew or edit" error.

Any help? I'm stuck.

Code:

Private Sub DecTuition_AfterUpdate()


Dim strWhere As String
Dim frm As Form
Dim rs As DAO.Recordset
Const searchvalue As String = "D"

strWhere = "[TriTerm] = " & """" & searchvalue & """"
Set frm = Me.frmInvoices.Form
Set rs = frm.RecordsetClone
rs.FindFirst strWhere
If rs.NoMatch Then
MsgBox "No Invoice Record Found To Update"
Else
frm.Bookmark = rs.Bookmark

Forms!frmOrdersACtive!frmInvoices.Form!TriAmountDu e.Value =
Forms!frmOrdersACtive!DecTuition.Value


End If



End Sub


Closed Thread