40K crashing Long Integer data type (1 Viewer)

Libre

been around a little
Local time
Today, 02:33
Joined
May 3, 2007
Messages
682
It took hours for me to find it because it SHOULDN'T crash. One record had a value of 40,000 for a certain column. The data type is Long Integer in the table. I should have a range of -trillions to +trillions. I can't understand why 40K is crashing it. I'm running the 64 bit version of Access too. When I reduced the value to 20K it ran fine. But that 40K value would cause the error handler to catch a Stack Overflow when trying to open the record.
Any ideas why? 40K is not that a big number.
 
That value is not making it crash, but likely something related to it.
You speak about Stack Overflow. Is there VBA code involved here, presumably behind a form that is bound to this table?

As a test, comment out all VBA, and Repair and Compact the app. Still a crash?
If yes, what if you have the Form wizard create a form on this table. Still a crash?

One oher thought: change the value to 32767. No crash? Then change to 32768. Crash? If so, you are overflowing integer data type (max 2^15-1).
 
Last edited:
There's VBA code that uses this value in many places.
However it's only declared one time in a Module: Global giCI as Long
Which I changed from: Global giCI as Integer

I don't want to comment out ALL the VBA because as I said - it's used in many places.
There's more testing I'll need to do to nail it down any further.
It MIGHT be that declaration change.
 
you need to revise the code that causes the error, eg:

Dim Result As long

Result = Clng(giCl) * Clng(anyValue)
 

Users who are viewing this thread

Back
Top Bottom