473,856 Members | 1,634 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Error 3021 description problem

I support an MS Access application in which errors are trapped using
the On Error statement. Just recently, the users of this system have
experienced run-time error number 3021 on a random basis. My biggest
problem right now is that the error description associated with this
error is Application-defined or object-defined error. It has always
been my understanding that these error numbers would not be used by
Microsoft and were available to application developers for their use
as in Err.Raise 3021, etc.

When I searched this group for this error, however, I see postings
that would indicate that 3021 is the No current record error. It
would appear that I might be having a problem with the table that
cross-references an error number to its description. I am having this
problem with my version of Access as well as at the client site. Both
sites are running Access 2000 Version 9.

Does anyone know of a fix for this short of reloading MS Access (which
will be a hard sell at the client site). Is this cross-referencing
done with a .dll or some other single file that can be reloaded?
Thanks.
Nov 12 '05 #1
9 10890
What do you mean by "these error numbers"? There have always been error
numbers used by the product. My recollection is that the series of errors
reserved for the developers were very large numbers, not the lower ones as
you describe.

Larry Linson
Microsoft Access MVP
"Robert Wing" <rc****@worldne t.att.net> wrote in message
news:9f******** *************** ***@posting.goo gle.com...
I support an MS Access application in which errors are trapped using
the On Error statement. Just recently, the users of this system have
experienced run-time error number 3021 on a random basis. My biggest
problem right now is that the error description associated with this
error is Application-defined or object-defined error. It has always
been my understanding that these error numbers would not be used by
Microsoft and were available to application developers for their use
as in Err.Raise 3021, etc.

When I searched this group for this error, however, I see postings
that would indicate that 3021 is the No current record error. It
would appear that I might be having a problem with the table that
cross-references an error number to its description. I am having this
problem with my version of Access as well as at the client site. Both
sites are running Access 2000 Version 9.

Does anyone know of a fix for this short of reloading MS Access (which
will be a hard sell at the client site). Is this cross-referencing
done with a .dll or some other single file that can be reloaded?
Thanks.

Nov 12 '05 #2
DFS
When is your error occurring? It's most likely not a random event.

You probably have some VBA code trying to reference a recordset which hasn't
returned any records.
"Robert Wing" <rc****@worldne t.att.net> wrote in message
news:9f******** *************** ***@posting.goo gle.com...
I support an MS Access application in which errors are trapped using
the On Error statement. Just recently, the users of this system have
experienced run-time error number 3021 on a random basis. My biggest
problem right now is that the error description associated with this
error is Application-defined or object-defined error. It has always
been my understanding that these error numbers would not be used by
Microsoft and were available to application developers for their use
as in Err.Raise 3021, etc.

When I searched this group for this error, however, I see postings
that would indicate that 3021 is the No current record error. It
would appear that I might be having a problem with the table that
cross-references an error number to its description. I am having this
problem with my version of Access as well as at the client site. Both
sites are running Access 2000 Version 9.

Does anyone know of a fix for this short of reloading MS Access (which
will be a hard sell at the client site). Is this cross-referencing
done with a .dll or some other single file that can be reloaded?
Thanks.

Nov 12 '05 #3
“these error numbers” are the numbers/values that Access
assigns to Err when a runtime error occurs. Err appears to be defined
as a long but I’m not sure that numbers above 65535 are valid.
In pseudo code, this is how you can print all the error codes (i) and
their corressponding description.

for i = 0 to 65535
print #1; i & “ - “ & Error(i)
next I
Nov 12 '05 #4
It is random but probably is occurring during an updating process. If
3021 is No current record then you are right and for some reason the
Recordset is bad or non-existent. Seems like I have tried all the
update combinations, however, and I can’t seem to replicate the
error. I made some code changes and added an error logging table
because of this problem. I didn’t get any entries for several
weeks and thought I had the problem licked. I check the last time I
was onsite and found that the error had occurred a couple of times.
Actually there were six entries total but they occurred in two groups
of three that were logged so close to each other (within seconds) that
I concluded that were part of the same event.

That said, I need to reiterate that my immediate problem appears to be
a problem getting the correct error description that corresponds to
the error number raised by Access. Thanks.
"DFS" <no****@nospam. com> wrote in message news:<vv******* *****@corp.supe rnews.com>...
When is your error occurring? It's most likely not a random event.

You probably have some VBA code trying to reference a recordset which hasn't
returned any records.

Nov 12 '05 #5
rc****@worldnet .att.net (Robert Wing) wrote in
<9f************ *************@p osting.google.c om>:
That said, I need to reiterate that my immediate problem appears
to be a problem getting the correct error description that
corresponds to the error number raised by Access.


My guess is that the problem is bubbling up through several layers
of unhandled errors. That is, you're getting the error message in a
context that is *very* different from the context that is actually
generating the error itself, and that's why it doesn't make any
sense.

This is a case where you need to have one of two situations:

1. everything error trapped.

OR

2. nothing error trapped.

With 1), you'll get the error in the immediate context in which it
occurs. With 2), you'll get the Access debugger's response to the
original error. Either way, you'll then know what is *really*
causing the error.

For what it's worth, I've found A2K to be much worse about
preserving original error context than A97. That is, practices that
worked fine for me for years and years are now causing problems
when the code is converted to A2K.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 12 '05 #6
Larry - I just realized that the answer that I posted to you question
earlier is off the mark. My reference to "these error numbers" refers
to all error numbers that cross-reference to the description
"Applicatio n-defined or object-defined error". Sorry.

"Larry Linson" <bo*****@localh ost.not> wrote in message news:<bC******* ************@nw rddc02.gnilink. net>...
What do you mean by "these error numbers"? There have always been error
numbers used by the product. My recollection is that the series of errors
reserved for the developers were very large numbers, not the lower ones as
you describe.

Larry Linson
Microsoft Access MVP

Nov 12 '05 #7
I'm new to this forum and need some basic help: how do you get
special characters to display correctly versus the &#8220, etc. that I
am getting (see below)? Thanks.

rc****@worldnet .att.net (Robert Wing) wrote in message news:<9f******* *************** ****@posting.go ogle.com>...
“these error numbers” are the numbers/values that Access
assigns to Err when a runtime error occurs. Err appears to be defined
as a long but I’m not sure that numbers above 65535 are valid.
In pseudo code, this is how you can print all the error codes (i) and
their corressponding description.

for i = 0 to 65535
print #1; i & “ - “ & Error(i)
next I

Nov 12 '05 #8
I think I have everything trapped but you have a good point. I'm not
sure I totally understand the "several layers of unhandled errors" you
mentioned but it seems that once you execute an On Error clause it
stays in effect even if you subsequently call another function or
subroutine unless you execute another On Error clause in the called
routine. Actually, now I wonder if part of my problem is the On Error
clause that executes in the called routine. I need to test that. I
try to display where the error occurs but that may not be working
correctly. I turn off error trapping when I am debugging in test but
I don't like to turn off all error trapping in production because the
users can be thrown into the code.

But I have a more fundimental problem here as well: If I go into the
immediate debug window and type: ? Error(3021) the response is
"Applicatio n-defined or object-defined error"
Based on what I see on this forum, if I enter: ? Error(3021) the
response should be: "No current record....", i.e, I think the process
that cross-references the error number to its corresponding error
description is malfunctioning and I don't know how to fix it.

dX********@bway .net.invalid (David W. Fenton) wrote in message news:<94******* *************** *****@24.168.12 8.74>...
rc****@worldnet .att.net (Robert Wing) wrote in
<9f************ *************@p osting.google.c om>:
That said, I need to reiterate that my immediate problem appears
to be a problem getting the correct error description that
corresponds to the error number raised by Access.


My guess is that the problem is bubbling up through several layers
of unhandled errors. That is, you're getting the error message in a
context that is *very* different from the context that is actually
generating the error itself, and that's why it doesn't make any
sense.

This is a case where you need to have one of two situations:

1. everything error trapped.

OR

2. nothing error trapped.

With 1), you'll get the error in the immediate context in which it
occurs. With 2), you'll get the Access debugger's response to the
original error. Either way, you'll then know what is *really*
causing the error.

For what it's worth, I've found A2K to be much worse about
preserving original error context than A97. That is, practices that
worked fine for me for years and years are now causing problems
when the code is converted to A2K.

Nov 12 '05 #9
rc****@worldnet .att.net (Robert Wing) wrote in
<9f************ **************@ posting.google. com>:
I think I have everything trapped but you have a good point. I'm
not sure I totally understand the "several layers of unhandled
errors" you mentioned but it seems that once you execute an On
Error clause it stays in effect even if you subsequently call
another function or subroutine unless you execute another On Error
clause in the called routine. Actually, now I wonder if part of
my problem is the On Error clause that executes in the called
routine. I need to test that. I try to display where the error
occurs but that may not be working correctly. I turn off error
trapping when I am debugging in test but I don't like to turn off
all error trapping in production because the users can be thrown
into the code.
Well, if you're not trapping errors in subroutines called in the
context in which your error handler is reporting the error, then
your choice is to turn off that local error handler or to add error
handling to all the subroutines called by it. One of these will
surely eventually flush out which exact line of code is truly
causing the error.
But I have a more fundimental problem here as well: If I go into
the immediate debug window and type: ? Error(3021) the response is
"Applicatio n-defined or object-defined error"
Based on what I see on this forum, if I enter: ? Error(3021) the
response should be: "No current record....", i.e, I think the
process that cross-references the error number to its
correspondin g error description is malfunctioning and I don't know
how to fix it.


But, as I said, the whole point is that in the context where the
error is being reported, you may not be in Jet/DAO, so you don't
get the appropriate error description. If the error handler is in a
context where it can't get to Jet/DAO (which is who the NO CURRENT
RECORD error belongs to, so far as I can tell), then the
"applicatio n" that is running (which is something *other* than
Jet/DAO) doesn't define the error message, and you're getting an
absolutely correct result, however useless it may be. Indeed, now
that I've thought about it, it indicates to me pretty clearly that
the error must be occurring in something at a lower level than the
error handler is defined.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 12 '05 #10

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

Similar topics

5
19381
by: Doslil | last post by:
I am trying to validate a text field where the user has to input the first name I am writing the following function Private Function EFN() On Error GoTo EFNErr If IsNull(Me.FirstName) Or Me.FirstName = "" Then MsgBox "Enter Employees First Name", vbOKOnly, "First Name" FirstName.SetFocus
1
6984
by: Colin Graham | last post by:
I am writing this piece of code to show the previous record on a control on the form but i keep getting the error message "Error 3021 no current record " and the line marked *** gets highlighted. I know its something to do with a blank or null record as the code works fine when i enter all details in the first record. If i omit data form the fields relating to the second loop i get the error. Can anyone please help????
2
3034
by: D-Zyl | last post by:
Hi everybody! my code is : ************************************************************* Private Sub Form_Open(Cancel As Integer) Dim db As DAO.Database Dim rs As DAO.Recordset Dim myvehicule As String
7
31430
by: ruvi | last post by:
I am getting runtime error 3021 - Either EOF or BOF is true or the current record has been deleted..... I have 2 combo boxes in a form- One for the client and the other for the project. When the form loads, the client combo box gets populated with all the clients. When a particular client is clicked, the project combo box gets populated with all the projects corresponding to that client. So far, so good. Now when I click a project in the...
1
3531
by: darrel | last post by:
Hi there, can someone tell me what is wrong with my code am getting a run time error 3021: Here my code: If rs.State = adStateOpen Then rs.Close rs.Open "Select * from where ID like 'ABA0102%'", cnn, adOpenKeyset, adLockOptimistic While rs.EOF <> True
4
3357
by: AXESMI59 | last post by:
I created a query in the Access Query Builder that I modified to use with VBA Code so I could reuse it for any record I choose. The one that I created with the Access Query builder works beautifully with the hardcoded criteria. The VBA version with my criteria being set by a variable returns Error 3021. I am using a DAO Recordset and all I want to do is retrieve the data to place into a report. The Original made in the Access Query Builder:...
0
1906
by: bssandeshbs | last post by:
I am developing a Address Book Database Project using Visual Basic 6... When i click the delete button the data does'nt get deleted in the FrontEnd ..But it gets deleted in Database when we see in Access... When i try to delete again in VB front End it gives a Error message and it gets RUN time Error 3021 Either BOF or EOF is true,or current record has been deleted..Requested operation requires a current Record... I am POSting the...
1
1805
by: ekawj | last post by:
Dear Teacher, I wrote program like below, Sub getdts() Dim ix, iy As Integer Dim tz, dz As String Dim V1A, V2A
7
5944
by: hpesoj | last post by:
When i copy data form to multiple form i get a "Run-time error 3021. No current record " in the line "rst2.MoveLast"...Can you help me out... Private Sub Process_AfterUpdate() Dim db As DAO.Database Dim rst11 As DAO.Recordset Dim rst10 As DAO.Recordset Dim rst9 As DAO.Recordset Dim rst8 As DAO.Recordset Dim rst7 As DAO.Recordset
0
9919
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
9763
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10699
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
10787
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
9534
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
7098
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();...
0
5762
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4578
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
2
4176
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.