Connecting Tech Pros Worldwide Help | Site Map

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

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 13th, 2005, 06:06 AM
crispywafers@yahoo.com
Guest
 
Posts: n/a
Default Update or CancelUpdate without AddNew or Edit Error on code run.

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


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.