MS Access and “Overflow” error message

I’m getting a weird message from a long time running Access database. The error message displays when running a vba code in a form, simply saying “Overflow”.
After googling around I found there’s a size limit involving Integer variables over 32767 and -32768, I’ve noticed the table counter has reached that limit and is handled in the vba code as an Integer variable. Simply change the variable to “Long” in the variable declaration header like the following example.
Change this:
Dim myintegervariable as Integer

Into this:
Dim myintegervariable as Long

And my database is back online.