Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / January 2006

Tip: Looking for answers? Try searching our database.

runtime error 6:  Overflow

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
BruceS - 27 Jan 2006 22:21 GMT
Could use some help on this one...

Have a fairly large, previously working Access 2K database running on XP Pro
machine.  Recently made minor change to one of the forms, added two named
queries, and added three new fields to two tables.  Afterward, when I run one
of the program's routines (to print a report with a bunch of imbedded
subreports), I get a "Runtime Error 6 - Overlfow" on a statement in the code
for one of the subreports.  Here is the code:

Private Sub SetFormats(Optional fmtType As String)
   Dim fmtMon As String
   Dim fmtDate As Integer
   Dim x As Long
   
   If IsMissing(fmtType) Then fmtType = "Regular"
   
   fmtDate = #1/1/2001#   'THIS LINE HIGHLIGHTED IN DEBUG
   For x = 1 To 12
...

(Not so) Funny thing is, the recent changes are not related in any way to
the subreport whose code is being executed.  The error is repeatable, and
always occurs in the same place in the code.

Tried Compact & Repair, and even creating a new database and importing all
of the objects (this sometimes works for odd Access problems) but it didn't
help.  MS Knowledge Base was of no help at all (So what's new?).

Any guesses on how to fix?

Thanks,
Bruce
Douglas J. Steele - 27 Jan 2006 23:29 GMT
Try

Dim fmtDate As Date

Dates are stored as 8 byte floating point numbers, where the integer portion
represents the date as the number of days relative to 30 Dec, 1899, and the
decimal portion represents the time as a fraction of a day. January 1st,
2001 happens to be 36,892 days since 30 Dec, 1899, and that's too large a
value to store in an Integer: they can only store values between -32,768 and
32,767.

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)

> Could use some help on this one...
>
[quoted text clipped - 32 lines]
> Thanks,
> Bruce
BruceS - 28 Jan 2006 00:00 GMT
Thanks, Doug.  

This one had been running so long that I didn't notice that the Dim had been
changed.  (The next one had been changed, too.)  There's only two of us that
work on it.  Probably his idea of a Friday afternoon joke.

Know anyone who breaks knees in their off time?

Bruce

> Try
>
[quoted text clipped - 43 lines]
> > Thanks,
> > Bruce
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.