473,406 Members | 2,312 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,406 software developers and data experts.

Problem with Overflow error message in Access

Hi,

I'm new at using Microsoft Access (2003), and I've created a "MonthlyReport" query, which has functioned properly in the past and I update the table monthly as I update the data in the underlying table and query files. All the query does is to run some calculations from data inputed every month, and it aggregates the results of those calculations in the report.

I tried to run or display the report under both 'Layout' and 'Print' Preview and I get the error message "Overflow". I'm not sure how to fix the problem. I've searched the forum for answers, but it couldn't find a close-match to guide me how to troubleshoot this problem.

I would greatly appreciate some pointers on how to address this problem.

Here is the SQL I copied from my file.
Expand|Select|Wrap|Line Numbers
  1. SELECT [2008Net_qry].GroupCode, PeerComp_tbl.GroupName, [2008Net_qry].FundID, IIf(PeerSet_tbl!PeerSet Is Not Null,"*","") AS PR, PeerComp_tbl.Type, PeerSet_tbl.PeerSet, IIf([2008Net_qry]!GroupCode="AGF","AGF","") AS Flag, [2008Net_qry].FundName, [2008Net_qry].IFSCType, [2008Net_qry].NetAssets, [2008Net_qry].Asset_Rank, [2008Net_qry]![2008_08_tbl.NewMo] AS CrntNet, IIf(IsNull([2008Net_qry]![2008_08_tbl.NewMo]),0,1) AS CrntNetFlag, [2008Net_qry]![2008_08_tbl.Net_Rank] AS CrntNetRnk, [2008Net_qry]![2008_07_tbl.NewMo] AS LstMNet, IIf(IsNull([2008Net_qry]![2008_07_tbl.NewMo]),0,1) AS LstMNetFlag, [2008Net_qry]![2008_07_tbl.Net_Rank] AS LstMNetRnk, [2008Net_qry]![2008_06_tbl.NewMo] AS 3mAgoNet, IIf(IsNull([2008Net_qry]![2008_06_tbl.NewMo]),0,1) AS 3mAgoNetFlag, nz([2008Net_qry]![2008_08_tbl.NewMo])+nz([2008Net_qry]![2008_07_tbl.NewMo])+nz([2008Net_qry]![2008_06_tbl.NewMo])+nz([2008Net_qry]![2008_05_tbl.NewMo])+nz([2008Net_qry]![2008_04_tbl.NewMo])+nz([2008Net_qry]![2008_03_tbl.NewMo])+nz([2008Net_qry]![2008_02_tbl.NewMo])+nz([2008Net_qry]![2008_01_tbl.NewMo])+0 AS CrntNetYTD, nz([2007Net_qry]![2007_08_tbl.NewMo])+nz([2007Net_qry]![2007_07_tbl.NewMo])+nz([2007Net_qry]![2007_06_tbl.NewMo])+nz([2007Net_qry]![2007_05_tbl.NewMo])+nz([2007Net_qry]![2007_04_tbl.NewMo])+nz([2007Net_qry]![2007_03_tbl.NewMo])+nz([2007Net_qry]![2007_02_tbl.NewMo])+nz([2007Net_qry]![2007_01_tbl.NewMo])+0 AS LstNetYTD, [2007Net_qry]![Net 2007] AS LstNetTtl, [2007Net_qry]!NetRnkCat AS LstNetTtlRnk, [2008Gross_qry]![2008_08_tbl.GrossSales] AS CrntGrs, IIf(IsNull([2008Gross_qry]![2008_08_tbl.GrossSales]),0,1) AS CrntGrsFlag, [2008Gross_qry]![2008_08_tbl.Gross_Rank] AS CrntGrsRnk, [2008Gross_qry]![2008_07_tbl.GrossSales] AS LstMGrs, IIf(IsNull([2008Gross_qry]![2008_07_tbl.GrossSales]),0,1) AS LstMGrsFlag, [2008Gross_qry]![2008_07_tbl.Gross_Rank] AS LstMGrsRnk, [2008Gross_qry]![2008_06_tbl.GrossSales] AS 3mAgoGrs, IIf(IsNull([2008Gross_qry]![2008_06_tbl.GrossSales]),0,1) AS 3mAgoGrsFlag, nz([2008Gross_qry]![2008_08_tbl.GrossSales])+nz([2008Gross_qry]![2008_07_tbl.GrossSales])+nz([2008Gross_qry]![2008_06_tbl.GrossSales])+nz([2008Gross_qry]![2008_05_tbl.GrossSales])+nz([2008Gross_qry]![2008_04_tbl.GrossSales])+nz([2008Gross_qry]![2008_03_tbl.GrossSales])+nz([2008Gross_qry]![2008_02_tbl.GrossSales])+nz([2008Gross_qry]![2008_01_tbl.GrossSales])+0 AS CrntGrsYTD, nz([2007Gross_qry]![2007_08_tbl.GrossSales])+nz([2007Gross_qry]![2007_07_tbl.GrossSales])+nz([2007Gross_qry]![2007_06_tbl.GrossSales])+nz([2007Gross_qry]![2007_05_tbl.GrossSales])+nz([2007Gross_qry]![2007_04_tbl.GrossSales])+nz([2007Gross_qry]![2007_03_tbl.GrossSales])+nz([2007Gross_qry]![2007_02_tbl.GrossSales])+nz([2007Gross_qry]![2007_01_tbl.GrossSales])+0 AS LstGrsYTD, [2007Gross_qry]![Gross 2007] AS LstGrsTtl, [2007Gross_qry]!GrsRnkCat AS LstGrsTtlRnk, [2006Net_qry]![Net 2006] AS 3yrAgoNetTtl, [2006Gross_qry]![Gross 2006] AS 3yrAgoGrsTtl, [2007Net_qry]![2007_08_tbl.NewMo] AS YrAgoNet, [2007Gross_qry]![2007_08_tbl.GrossSales] AS YrAgoGrs
  2. FROM ((((((2008Net_qry LEFT JOIN 2006Net_qry ON [2008Net_qry].FundID = [2006Net_qry].FundID) LEFT JOIN 2007Net_qry ON [2008Net_qry].FundID = [2007Net_qry].FundID) LEFT JOIN 2007Gross_qry ON [2008Net_qry].FundID = [2007Gross_qry].FundID) LEFT JOIN PeerSet_tbl ON [2008Net_qry].FundID = PeerSet_tbl.FundID) LEFT JOIN PeerComp_tbl ON [2008Net_qry].GroupCode = PeerComp_tbl.GroupCode) LEFT JOIN 2008Gross_qry ON [2008Net_qry].FundID = [2008Gross_qry].FundID) LEFT JOIN 2006Gross_qry ON [2008Net_qry].FundID = [2006Gross_qry].FundID;
Appreciate the prompt feedback in advance.
Sep 19 '08 #1
7 1636
FishVal
2,653 Expert 2GB
Hello.

Before posting the whole query in all its glory you might localize error source yourself.
  • Run the query itself. Does it produce the same error?
  • Sequentially one-by-one remove from the query fetched fields (starting from calculated ones).
  • If the datasets join with only one non-calculated field (try different ;)) produce the same error, then try to rebuild the query joining datasets one-by-one.

Kind regards,
Fish
Sep 19 '08 #2
Hello.

Before posting the whole query in all its glory you might localize error source yourself.
  • Run the query itself. Does it produce the same error?
  • Sequentially one-by-one remove from the query fetched fields (starting from calculated ones).
  • If the datasets join with only one non-calculated field (try different ;)) produce the same error, then try to rebuild the query joining datasets one-by-one.

Kind regards,
Fish
Thanks Fish. I am a newbie to Access and the biggest challenge is I am not the creator of this database and therefore, don't have a clue what these syntax expressions mean. Per your instruction, can you provide some pointers using the query I copied in the enquiry to start off the self-checking process?

Many thanks.
Sep 19 '08 #3
missinglinq
3,532 Expert 2GB
Runtime Error 6: Overflow is caused when you try to cram 10 # of potatoes into a 5 # bag!

One or more of your calculations are resulting in an answer being stored in a field that is too small to hold it. An example would be field, let's call it MyNumber, whose Fieldsize is defined as an Integer. An Integer can hold values up to 32,767. If you were to make an assignment such as

MyNumber = 20000 * 5

it would cause an Overflow error, because 20000 * 5 = 100000 and that result is too large for MyNumber to hold it. The answer, of course, is to change the Fieldsize to one that can hold it, such as a Long Integer, which can hold values up to 2,147,483,647.

When you see a thread where the poster says, "This has worked without a problem for months and now it suddenly starts giving an Overflow error," the problem usually involves something such as a "year-to-date total" field. The calculations run, without problems, early in the year because the total doesn't exceed the Fieldsize limit, but as the "year-to-date total" grows it eventually outstrips the limit and the error pops.

Look at your Fieldsizes in your tables and figure out which totals being assigned into fields that are too small.

Welcome to Bytes!

Linq ;0)>
Sep 19 '08 #4
Thanks for this - I have been checking a number of blogs on resolving this issue and would like ask to make such conversion, do I need to put 'CLng' in front of the syntax expression that calculates the YTD number?

Many thanks.







Runtime Error 6: Overflow is caused when you try to cram 10 # of potatoes into a 5 # bag!

One or more of your calculations are resulting in an answer being stored in a field that is too small to hold it. An example would be field, let's call it MyNumber, whose Fieldsize is defined as an Integer. An Integer can hold values up to 32,767. If you were to make an assignment such as

MyNumber = 20000 * 5

it would cause an Overflow error, because 20000 * 5 = 100000 and that result is too large for MyNumber to hold it. The answer, of course, is to change the Fieldsize to one that can hold it, such as a Long Integer, which can hold values up to 2,147,483,647.

When you see a thread where the poster says, "This has worked without a problem for months and now it suddenly starts giving an Overflow error," the problem usually involves something such as a "year-to-date total" field. The calculations run, without problems, early in the year because the total doesn't exceed the Fieldsize limit, but as the "year-to-date total" grows it eventually outstrips the limit and the error pops.

Look at your Fieldsizes in your tables and figure out which totals being assigned into fields that are too small.

Welcome to Bytes!

Linq ;0)>
Sep 22 '08 #5
I finally figured out the way to change the 'fieldsize' but confirmed that the existing setting for 'number' is already preset as 'Long Integer'. Any suggestions of what to look for next?
Sep 22 '08 #6
FishVal
2,653 Expert 2GB
I finally figured out the way to change the 'fieldsize' but confirmed that the existing setting for 'number' is already preset as 'Long Integer'. Any suggestions of what to look for next?
You should better first localize error source. Otherwise you will seek a black cat in a dark room.
A good start is to open the query in design view and start unchecking query fields one-by-one and running those simplified variants.
Another good start is to run one-by-one all those source queries - one or more could be well a source of error.

Regards,
Fish
Sep 22 '08 #7
Thanks for the pointers - will test it out. =)
Sep 23 '08 #8

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

Similar topics

2
by: Eugene | last post by:
Hi, In Query Analyzer: update tblUserProcess set usercode = 1002 Error: Arithmetic overflow error for data type tinyint, value = 1002. The statement has been terminated.
7
by: MLH | last post by:
?2944*24 gives me an overflow error, entered in the immediate window. Anybody else?
4
by: Christaaay | last post by:
I have been using the code below successfully for almost a year. yesterday, I began getting a run time error 6 (overflow). I am using the code in an Access 2000 database. Can anyone help me...
2
by: jay | last post by:
I am attempting to impersonate an account in ASPNET. I am using aspnet_setreg to store the username and passwords. I have given the ASPNET account permisision to read the registry values. However,...
3
by: SheldonMopes | last post by:
I sometimes get a pop-up box that reads "Overflow" and the module that is executing pauses. It doesn't get caught by my error trapping, and it seems to be randow. By random, I mean usually in the...
4
by: Wiline | last post by:
Hi, I'm new at using Microsoft Access (2000), and I've been working on a relatively simple scientific database. I've created a "MakeTable" query, which has worked well in the past and I update...
10
by: hsmit.home | last post by:
Hi everyone, I'm having some difficulty with the following piece of code. I have stripped it to it's bare minimum to demonstrate the problem at hand. Compiler: MS Visual C++ 2005 Express...
1
by: innivive | last post by:
I am having a problem with having margins display correctly in IE7, Firefox and Safari. I am not sure if it is the "double margin error" or something else. Any help would be appreciated. The file...
0
by: bradman1861 | last post by:
hello i am getting a overflow error when I try to run this: here is the error: System.Data.OleDb.OleDbException was unhandled Message="Overflow" Source="Microsoft JET Database Engine" ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
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...

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.