Overflow error

  • Thread starter Thread starter Greg Nelson
  • Start date Start date
G

Greg Nelson

I have an ADO (VBA) query that runs against SQL Server
with no problem, in this case extracting 96,000 records
that IO am able to loop thru with no problem. However
when I write these records to an Access2002 table (using
Addnew and Update) I get an OVERFLOW error (err.number=6)
when I hit record 32,767. DoEvents doesnt help. Any
ideas anybody ?
 
Sounds as if you've Dimmed the Loop variable as an integer (max value 32K). Try
Dimming the loop variable as a Long.

Dim lngCount As Long

For lngCount = 1 to SomeMaxNumber
'Do stuff
Next lngcount

Without seeing the code (or at least relevant snippets) this is a guess. But
almost for sure you have a variable or value that should be type Long and you
have it as type integer.
 
Back
Top