473,698 Members | 2,086 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

error message!

Hello again everyone,

Hope you can help.

I have a form with a lot of code going on in the background but I
can't find the route cause of the following error message.

Update or Cancel Update Without Add New or Edit.

I understand that when trying to update records you have to work
correctly with recordsets etc which I am ok with. But this error
occurs seemingly on a random basis. The error occurs when the users
click (not tab) into some of the fields on the form.
This error also doesn't allow me to look into the code (ie no debug
option in the error window and no response to Break).

It can't be the code in the fields because I don't have any on click
or on enter event handlers. On any of the fields that the error has
occured on.

Does anyone have any ideas?
Nov 12 '05 #1
3 3277
Without your code, it's hard to tell, but here's a link to a Google
post that was about this subject ...
http://groups.google.com/groups?hl=e...D100%26hl%3Den
(watch for word wrap on this long, long link)

Basically, it says your recordset code should follow this pattern.

If Not rst.BOF Then rst.MoveFirst
Do Until rst.EOF
rst.Edit
rst!FieldName = "my text"
rst.Update
rst.MoveNext
Loop

Are you doing a MoveFirst to begin? Are you calling the Edit method?
Maybe you should post your code.
--
Danny J. Lesandrini
dl*********@hot mail.com
http://amazecreations.com/datafast
"Michael" <we****@hotmail .com> wrote in message news:af******** *************** ***@posting.goo gle.com...
Hello again everyone,

Hope you can help.

I have a form with a lot of code going on in the background but I
can't find the route cause of the following error message.

Update or Cancel Update Without Add New or Edit.

I understand that when trying to update records you have to work
correctly with recordsets etc which I am ok with. But this error
occurs seemingly on a random basis. The error occurs when the users
click (not tab) into some of the fields on the form.
This error also doesn't allow me to look into the code (ie no debug
option in the error window and no response to Break).

It can't be the code in the fields because I don't have any on click
or on enter event handlers. On any of the fields that the error has
occured on.

Does anyone have any ideas?

Nov 12 '05 #2
Danny,
Thanks for your message. The problem is finding out where the error
is occuring because the error doesn't seem to be occuring on any code
that I can detect.

I have wrapped all of my code with a error tracking script that writes
all the errors to a table, but this hasn't turned anything up.

One suggestion is to export all the database objects to another blank
database which might clear any niggly errors like this. I might try
this if I don't get any joy.

Thanks again for your help.

:)
"Danny J. Lesandrini" <dl*********@ho tmail.com> wrote in message news:<br******* ****@ID-82595.news.uni-berlin.de>...
Without your code, it's hard to tell, but here's a link to a Google
post that was about this subject ...
http://groups.google.com/groups?hl=e...D100%26hl%3Den
(watch for word wrap on this long, long link)

Basically, it says your recordset code should follow this pattern.

If Not rst.BOF Then rst.MoveFirst
Do Until rst.EOF
rst.Edit
rst!FieldName = "my text"
rst.Update
rst.MoveNext
Loop

Are you doing a MoveFirst to begin? Are you calling the Edit method?
Maybe you should post your code.
--
Danny J. Lesandrini
dl*********@hot mail.com
http://amazecreations.com/datafast
"Michael" <we****@hotmail .com> wrote in message news:af******** *************** ***@posting.goo gle.com...
Hello again everyone,

Hope you can help.

I have a form with a lot of code going on in the background but I
can't find the route cause of the following error message.

Update or Cancel Update Without Add New or Edit.

I understand that when trying to update records you have to work
correctly with recordsets etc which I am ok with. But this error
occurs seemingly on a random basis. The error occurs when the users
click (not tab) into some of the fields on the form.
This error also doesn't allow me to look into the code (ie no debug
option in the error window and no response to Break).

It can't be the code in the fields because I don't have any on click
or on enter event handlers. On any of the fields that the error has
occured on.

Does anyone have any ideas?

Nov 12 '05 #3
On 10 Dec 2003 15:44:39 -0800 in comp.databases. ms-access,
we****@hotmail. com (Michael) wrote:
Danny,
Thanks for your message. The problem is finding out where the error
is occuring because the error doesn't seem to be occuring on any code
that I can detect.

I have wrapped all of my code with a error tracking script that writes
all the errors to a table, but this hasn't turned anything up.

One suggestion is to export all the database objects to another blank
database which might clear any niggly errors like this. I might try
this if I don't get any joy.


That won't help, it's a PITA I have to live with, maybe some
triggering code that updates another bound control on the form and yes
it happens randomly (not in any recordset based operations so the help
and KB on it are useless).

Below is some trapping code I came up for it, works most of the time,
basically it runs around the form and collects all the values so far,
undoes the current record then goes around and pokes everything back
in.

in the form use:

Private Sub Form_Error(Data Err As Integer, Response As Integer)
Dim lngError As Long

lngError = DataErr
Select Case lngError
Case 7787, 7786, 0 ' can't remember what these were :-\
Response = acDataErrContin ue
Case 3020
Error3020 Me, Response
Case Else
MsgBox "Error #" & lngError & " - " &
AccessError(lng Error), vbCritical, Me.Name & " Form Error Event"
Response = acDataErrDispla y
End Select
End Sub

An in the timer event:

Private Sub Form_Timer()
Select Case Me.TimerInterva l
Case 302
Me.TimerInterva l = 301
Error3020Timer
Case Else
End Select
End Sub

Now the module that does the bees knees:
(basSillyErrors )
Option Compare Database
Option Explicit

Dim mstrParentFormN ame3020 As String
Dim mstrFormName302 0 As String
Dim mstrCtlName3020 As String
Dim mvarCtlValue302 0 As Variant
Function Error3020(pfrm As Form, Response As Integer)
' Error Trapped: 06/05/2000 10:00:36 sa
On Error GoTo Error3020_Err
' called from Form Error 3020 that hapens when Access gets
' it's knickers in a twist.
Dim varCtl() As Variant
Dim ctl As Control, i As Integer

' reset these
mstrParentFormN ame3020 = Screen.ActiveFo rm.Name
mstrFormName302 0 = pfrm.Name
mstrCtlName3020 = ""
mvarCtlValue302 0 = Null

ReDim varCtl(0 To pfrm.Controls.C ount - 1)
For Each ctl In pfrm.Controls
varCtl(i) = Null
' cannie do anything with the current
' control
If ctl.Name <> pfrm.ActiveCont rol.Name Then
varCtl(i) = ControlValue(ct l)
Else
' plug these in in the timer event as it won't
' accept them until after this error event
' has completed.
mstrCtlName3020 = pfrm.ActiveCont rol.Name
mvarCtlValue302 0 = ctl.Text
End If
Debug.Print varCtl(i)
i = i + 1
Next
pfrm.Undo
pfrm.Undo

i = 0

For Each ctl In pfrm.Controls
Debug.Print ctl.Name
If Not ctl.ControlSour ce Like "=*" Then
If Left(varCtl(i), 7) <> "#Error " Then
If "" & ctl.Value <> "" & varCtl(i) Then
If ctl.Name <> pfrm.ActiveCont rol.Name Then
ctl.Value = varCtl(i)
End If
End If
End If
End If
i = i + 1
Next

Response = acDataErrContin ue
' set up the timer to plug the values into
' the current control but you must make sure that
' the form's timer event calls Error3020Timer if the
' TimerInterval property is set to 302 and also
' set it to a different value so it don't keep
' on calling the code every 302 milliseconds.
pfrm.TimerInter val = 302 ' (3020/10)

Error3020_Exit:
On Error Resume Next
Exit Function
Error3020_Err:
Select Case Err
Case 438 ' object doesn't support this property or method
' who gives a rat's arse?
Resume Next
Case Else
LogMsgBox Err, Err.Description , 16, "Error #" & Err & " In
Error3020()"
End Select
Resume Error3020_Exit
Resume
End Function

Public Function Error3020Timer( )
' Error Trapped: 07/11/2001 16:58:35 sa
On Error GoTo Error3020Timer_ Err

Dim frm As Form, ctl As Control

If mstrFormName302 0 = mstrParentFormN ame3020 Then
Set frm = Forms(mstrFormN ame3020)
Else
Set frm =
Forms(mstrParen tFormName3020). Controls(mstrFo rmName3020).For m
End If
Set ctl = frm(mstrCtlName 3020)
ctl.Value = mvarCtlValue302 0
Set ctl = Nothing
Set frm = Nothing

Error3020Timer_ Exit:
On Error Resume Next
Exit Function
Error3020Timer_ Err:
Select Case Err
Case 3162 ' IOW Invalid use of Null
' happens if the mvarCtlValue302 0 got null from the
handler and the ctl in
' question was a checkbox, as it's the current control it
had no text
' property in the handler so a null was returned. Not sure
what happens at
' this stage as it's difficult to see being as the error
occurs randomly
' and only occasionally. Hopefully the value of the
checkbox will be changed
' to what the user wants but if not then it should look
like the user is
' cack handed and didn't click on it properly... hehe.
Resume Next
Case Else
LogMsgBox Err, Err.Description , 16, "Error #" & Err & " In
Error3020Timer( ) while trying to recover from Error 3020"
End Select
Resume Error3020Timer_ Exit
Resume
End Function
Function ControlValue(pc tl As Control) As Variant
' TB 30/10/2001
' Returns the value of a control, if that control
' is something that doesn't have one then returns:
' #Error <num> - <errortext>
'
On Error Resume Next

Dim varvalue As Variant
varvalue = Null
varvalue = pctl.Value
If Err.Number Then
varvalue = "#Error " & Err.Number & " - " & Err.Description
End If
ControlValue = varvalue
End Function

--
A)bort, R)etry, I)nfluence with large hammer.
Nov 12 '05 #4

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

Similar topics

10
10814
by: | last post by:
I am accessing the same error-containing ASP page on an ISP server using w2k IE6 but with different effect. On the first computer I get several line of HTML outputed by ASP, shown correctly by the browser, followed by a descriptive error message: Microsoft VBScript runtime error '800a000b' Division by zero followed by the number of the error-making line
9
4910
by: Mairhtin O'Feannag | last post by:
Hello, We have two machines we wish to use DPF. They are both RH ES 2.1, with DB2 8.2. I read the documentation CAREFULLY, and added the following line to my db2nodes.cfg file : 1 egret 0
6
8456
by: Squirrel | last post by:
I have a command button on a subform to delete a record. The only statement in the subroutine is: DoCmd.RunCommand acCmdDeleteRecord The subform's recordsource is "select * from tblVisit order by VisitDt" I'm getting this error message: Errno is 2465. Err.description is "Can't find field '|' referred to in your expression"
8
10009
by: Rod | last post by:
I have been working with ASP.NET 1.1 for quite a while now. For some reason, opening some ASP.NET applications we wrote is producing the following error message: "The Web server reported the following error when attempting to create or open the Web project located at the following URL: 'http://localhost/WebApplication1'. 'HTTP/1.1 500 Internal Server Error'."
10
8707
by: Shawn | last post by:
JIT Debugging failed with the following error: Access is denied. JIT Debugging was initiated by the following account 'PLISKEN\ASPNET' I get this messag in a dialog window when I try to open an asp.net page. If I press OK then I get a page with this message: Server Application Unavailable The web application you are attempting to access on this web server is currently unavailable. Please hit the "Refresh" button in your web browser...
16
2941
by: | last post by:
Hi all, I have a website running on beta 2.0 on server 2003 web sp1 and I keep getting the following error:- Error In: http://www.mywebsite.org/WebResource.axd?d=5WvLfhnJp5Lc8WhQSD4gdA2&t=632614619884218750 -------------------------------------------------------------------------------- System.Security.Cryptography.CryptographicException: Padding is invalid and cannot be removed. at...
2
5324
by: f rom | last post by:
----- Forwarded Message ---- From: Josiah Carlson <jcarlson@uci.edu> To: f rom <etaoinbe@yahoo.com>; wxpython-users@lists.wxwidgets.org Sent: Monday, December 4, 2006 10:03:28 PM Subject: Re: 1>make_buildinfo.obj : error LNK2019: unresolved external symbol __imp__RegQueryValueExA@24 referenced in function _make_buildinfo2 Ask on python-list@python.org . - Josiah
2
19474
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I will be writing this article intended for those who are in the same level, or maybe lower, of my technical knowledge. I would be using layman's words, or maybe, my own words as how I understand them, hoping, you will understand it the same way that...
0
2897
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I will be writing this article intended for those who are in the same level, or maybe lower, of my technical knowledge. I would be using layman's words, or maybe, my own words as how I understand them, hoping, you will understand it the same way that...
0
8674
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9157
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9028
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8895
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8861
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7728
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5860
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3046
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.