Connecting Tech Pros Worldwide Help | Site Map

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

  #1  
Old November 13th, 2005, 07:06 AM
crispywafers@yahoo.com
Guest
 
Posts: n/a
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete Duplicate records Theodore70 answers 15 July 15th, 2008 12:33 PM
Loop through checkboxes using ADO – Access 2003 mrowe answers 3 March 21st, 2007 03:28 PM
Getting error on VBA routine ljungers answers 8 March 11th, 2007 06:44 PM
Edit, Delete, Update ... Error :-( Stephen answers 4 November 13th, 2005 01:38 AM