473,410 Members | 1,875 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,410 software developers and data experts.

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

Nov 13 '05 #1
0 2849

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Trevor Best | last post by:
Access 2002 MDB -> SQL Server 2000 - ODBC Linked tables. B4 we start, this is not occurring in a recordset operation and yes I googled, even found my own fix, which I already use...
2
by: JSMiami | last post by:
I have a form that has the navigation buttons enabled. I have a procedure that runs every time a new record is loaded (Current Event). This procedure performs a SELECT from a table (different from...
2
by: NewDBGirl | last post by:
I have a multiple-page form for entering info about a project with several sub-forms for sub-projects, notes and tasks. The form and one of the sub-forms each have a combo box to select a record...
4
by: Stephen | last post by:
Hello People, Using MS Access 2003 VBA I get the error 3020 Update or CancelUpdate without AddNew or Edit when I run through the following code. Can anyone help suggest anything to try? Thanks....
4
by: paulwilliamsonremove | last post by:
Hi, I Googled the subject and couldn't find solution (DoCmd Save.... didn't work). I tried this code in the Form's Open and Load. I am just trying to populate UNBOUND fields on a form. I...
2
by: bbasberg | last post by:
I have been working hard to clean up my code but I am still wondering why all incoming records go to the "AddNew" part of the IF statement and never to the Edit alternative. I believe that it must be...
9
bhcob1
by: bhcob1 | last post by:
Hey guys, 'Update or CancelUpdate without AddNew or Edit' On my database i keep occasionly get this error when i try and edit a field, it is not everytime. It will be working fine and then this...
9
anastasius
by: anastasius | last post by:
I have read other posts with a similar problem but I have not read of one like this. When a user selects a name from the drop-down list called "cboLastName" (which is unbound and whose...
5
by: fieldling | last post by:
I've written the following code to update a recordset but when I run it I get a Run-time error 3020: Update or CancelUpdate without AddNew or Edit. When I debug it highlights the rs.update line. I've...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.