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

Home Posts Topics Members FAQ

Error 3021 no current record access 2000

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????
Do

If rst!Diastolic <> rst.BOF Or rst!Diastolic <> rst.EOF Then
dias = rst!Diastolic
sys = rst!Systolic
PrevDate = rst!DATE
Else: rst.MovePreviou s
End If

Loop Until dias <> ""

rst.MoveLast

Do

*** If rst!AmbSystolic <> rst.BOF Or rst!AmbSystolic <> rst.EOF
Then***
ambSys = rst!AmbSystolic
ambDias = rst!AmbDiastoli c
AmbPrevDate = rst!DATE
Else: rst.MovePreviou s
End If
Loop Until ambDias <> ""

rst.MoveLast
Nov 12 '05 #1
1 6985
rst.BOF and rst.EOF will simply return True or False. So, in your If
statement, you are comparing the value of the field to True or False. Access
will interpret a value of zero as false and any other number as True. If the
field is Null, you'll get an error.

Are you simply trying to see if there are any records? If so

If Not (rst.BOF And rst.EOF) Then 'there are some records

--
Wayne Morgan
Microsoft Access MVP
"Colin Graham" <cs********@hot mail.com> wrote in message
news:ee******** *************** ***@posting.goo gle.com...
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????
Do

If rst!Diastolic <> rst.BOF Or rst!Diastolic <> rst.EOF Then
dias = rst!Diastolic
sys = rst!Systolic
PrevDate = rst!DATE
Else: rst.MovePreviou s
End If

Loop Until dias <> ""

rst.MoveLast

Do

*** If rst!AmbSystolic <> rst.BOF Or rst!AmbSystolic <> rst.EOF
Then***
ambSys = rst!AmbSystolic
ambDias = rst!AmbDiastoli c
AmbPrevDate = rst!DATE
Else: rst.MovePreviou s
End If
Loop Until ambDias <> ""

rst.MoveLast

Nov 12 '05 #2

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

Similar topics

9
10891
by: Robert Wing | last post by:
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...
2
2142
by: John Sims | last post by:
Hello All, Anybody out there know what this error is...I'm getting it while trying to create a partial replica from a full replica made from the design master. "The Partial Replica Wizard has encountered an error while trying to populate your partial replica with data. The error that the Jet Engine has returned is: Reserved error (-1613); there is no message for this error. After resolving this error, you can run the Wizard
2
3530
by: dixie | last post by:
Can someone please give me the error number for this error? dixie
3
2070
by: windandwaves | last post by:
Hi, I am trying to make errors a bit more meaningful for my users. I am trying to fix error 3201 where there is a missing field in a form. If I do not do any error trapping, then I get You cannot add or change a record because a related record is required in table 'my table name'.
2
3631
by: Robert | last post by:
I have a label on my form lblCount and the following code in my form for displaying a record count: Private Sub Form_Current() Me.RecordsetClone.Bookmark = Me.Bookmark Me!lblCount.Caption = Me.RecordsetClone.AbsolutePosition + 1 End Sub It works fine until I page to the last record and I get:
0
1981
by: user_5701 | last post by:
I have an Access 97 database front end (with some lookup tables there too) which also has a MS SQL Server 2000 back end, where all the rest of the larger tables are. I recently had some problems with people being able to access things, getting ODBC errors when trying to open tickets. I checked the file DSN advanced configuration and changed it from named pipes to tcp/ip which is what it should have been in the first place (I think there...
5
3193
by: prakashwadhwani | last post by:
The Delete Event/Proc & "Save_Fields_In_Form_Header" Event/Proc in my form were working perfectly. However, after I added a call to the "Save_Fields_In_Form_Header" Event/Proc in the "Current" Event of my form, and I now try to Delete a record, I get ... Run-Time Error 3218 - Could not Update; Currently Locked. My Access application then effectively freezes forcing me to shut Access down & re-start. The record DOES get deleted...
4
2517
by: Oseyo | last post by:
I'm working with Access 2000 Version 9.0. I closed a Database that i was working on and on opening it up again an Error Message displayed "No Current Record" the Help File displays the Error Code as 3021. How do i open the Database and retrieve my Data? I have in the database about 3000 Entries of Peoples Details. It took about two months to enter all of it and now i can't access it. Please Help. Oseyo Ephraims
0
1907
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...
0
9921
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
9765
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
10700
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
10795
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,...
1
7934
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
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
5763
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
4581
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
4177
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.