473,804 Members | 3,272 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Error 6: Overflow error

2 New Member
Hi Guys

I have inherited an Access DB in a very poorly state! I have offered to make some changes to it for a local charity but have got stuck on this error it seems to be creating for all new records.

I am working within a Form which is calling another Form matched on the ID, this is within Access 2000. Clicking the cmdLinkExisting CaredFor_Click produces an Error 6: Overflow error.

Can anyone help me as to what maybe making the code fall down?

Expand|Select|Wrap|Line Numbers
  1. Private Sub cmdLinkExistingCaredFor_Click()
  2. On Error GoTo Err_cmdLinkExistingCaredFor_Click
  3.  
  4. Set dbs = CurrentDb
  5. Set rst = dbs.OpenRecordset("SELECT * FROM tblPeople " & _
  6. "WHERE tblPeople.PersonType = 'Cared For' OR tblPeople.PersonType = 'Both' ")
  7. If rst.RecordCount > 0 Then
  8. Me.Tag = Me.CurrentRecord
  9. stLinkCriteria = "[CarerID]= " & Me.PersonID
  10. stDocName = "frmExistingCaredForByCarer"
  11. DoCmd.OpenForm stDocName, , , stLinkCriteria, , , Me.txtForeName & " " & Me.txtFamilyName
  12. Else
  13. MsgBox "There are NO 'Cared Fors' in the database."
  14. End If
  15.  
  16. Exit_cmdLinkExistingCaredFor_Click:
  17. Exit Sub
  18.  
  19. Err_cmdLinkExistingCaredFor_Click:
  20. Call LogError(Err.Number, Err.Description, Me.Name, "cmdLinkExistingCaredFor_Click")
  21. Resume Exit_cmdLinkExistingCaredFor_Click
  22.  
  23. End Sub
Any help would be much appreciated - was just trying to do someone a favour but got in a little over my head!!!
Oct 21 '07 #1
2 2594
FishVal
2,653 Recognized Expert Specialist
Hi, Angie.

First localize faulty code.

Comment out
On Error GoTo Err_cmdLinkExis tingCaredFor_Cl ick
line and see where code execution stops.
Oct 21 '07 #2
nico5038
3,080 Recognized Expert Specialist
Also add a test after the SET of rst or record(s) have been found like:
Expand|Select|Wrap|Line Numbers
  1. Set rst = dbs.OpenRecordset("SELECT ....
  2. IF rst.EOF and rst.BOF then
  3.     ' the action when there's no record found with e.g. a msgbox and an exit
  4. endif
  5.  
To have a correct recordcount you would also need to use:

Expand|Select|Wrap|Line Numbers
  1. rst.movelast
before testing the recordcount.

Nic;o)
Oct 22 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
2593
by: Jeff | last post by:
Dim lngWeights as long, lngBuckets as Long Const STDWEIGHTS = 12 lngBuckets = 1000 lngWeights = lngBuckets * STDWEIGHTS This causes an Overflow error. For lower values it works. Obviously the result of 36000 is more than an Integer can take, but not a Long?? Yes, I did double-check my code.
7
2156
by: MLH | last post by:
?2944*24 gives me an overflow error, entered in the immediate window. Anybody else?
4
12899
by: Chua Wen Ching | last post by:
Thanks Derek... Okay i had another question.. my program runs smoothly for the first minute, after 1 minute... suddenly it breaks and display this error: do you know what is the cause of this problem...
8
2533
by: rollasoc | last post by:
Hi, Made me laugh so I though I'd share this. short i = 32; short j = 1; short k = i + j; gives an error Cannot implicitly convert type 'int' to 'short'
1
3321
by: zaneh | last post by:
I have found TheScripts a very useful site, but however I cannot find an answer to a problem I am having, so I finally have to ask the question! I am getting an Overflow error in a Function I have written. BUT... It does not occur all the time. If I call the Function from the "After Update" event for a checkbox, it works as intended, how ever if I call the Function from the "On Load" event of the Form, testing to see whether the...
1
4260
by: nancyisbell | last post by:
I used the following test01.xml file below to exercise the cnlUnit01.xslt. <?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="cnlUnit01.xslt"?> <cnlUnitXsl unitDataFile="111111"/> The cnlUnit01.xslt file below should recursively concatenate the string "Level", the string " ", and the numeric value of the number (level) of recursions that occur, and print that 10073 times in
3
2165
by: MLH | last post by:
A wide comma delimited text file import into A97 failed with an overflow error. I'm estimating it to have been no more than 1000 records. 100% of all the fields were quoted strings or ZLS's. What most likely caused the overflow? Might it be upper limit on number of fields in table?
5
1704
by: mike3 | last post by:
Hi. Is this a good idea?: <begin code> /* Addition operator: += */ const BigFix &BigFix::operator+=(const BigFix &rhs) { ErrorType err; int lhs_sign = sign, rhs_sign = rhs.sign;
3
10746
by: jer006 | last post by:
Hi I am writing a select statement that has an arithmetic function inside a case statement that uses logic to decide whether to divide or multiply and when I run the arithmetic statements outside the case statement they work fine, but blow up with an overflow error in the case statement. The select looks like: SELECT a.acct_cd, a.crrncy_cd, a.mkt_val, c.rate,
13
2571
by: mike3 | last post by:
Hi. (crossposted because the program is in C++ and some C++-related elements are discussed, hence comp.lang.c++, plus general program design questions are asked, hence comp.programming.) I'm making this bignum package in C++. I'm wondering though on how to handle the errors. Right now most operations routines return error codes if they fail -- but some routines they use inside them, or overloaded operators, will throw exceptions on...
0
9708
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
9588
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
10589
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
10340
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
10327
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
10085
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
9161
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
6857
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
4302
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

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.