Forum Discussion
Access_Jim
Jul 27, 2024Tin Contributor
Mysterious Overflow Error
This Access VBA code is giving me an overflow error. What am I doing wrong? Dim chunkSize As Long chunkSize = 320 * 1024 Also, I tried changing chunkSize to a Double, but got the same ove...
- Jul 29, 2024
Hi,
You are not the first to wonder about the VBA behaviour to "coerce" numbers into an integer. Have a look at the very similar example in the error documentation: Overflow (Error 6)
Servus
Karl
****************
Access News, Forever, DevCon
Access-Entwickler-Konferenz AEK - 19./20.10. Nürnberg
peiyezhu
Jul 27, 2024Bronze Contributor
It looks fine.
Have you testes these VBA in a new .accdb or Excel VBA?
Have you testes these VBA in a new .accdb or Excel VBA?
Access_Jim
Jul 28, 2024Tin Contributor
It is a new .accdb. I found that when I reduce it to 30 * 1024, it no longer throws the error. But it seems like datatype Long should be able to handle 320 * 1024