Overflow error

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am receiving an overflow error when this line is executed...

varSource = Nz(rstExcelRS.Fields(strIndexName).Value, -1)

The values are retrieved from a spreadsheet. The code was working fine
until it reached the value 38387. There isn't any calculations, so what
could be the problem? Do I need to set varSource back to 0 each time?
 
Any chance that varSource is declared as an Integer data type? If so, change
it to a Long (aka Long Integer) data type.
Assigning a value greater than 32,767 to an Integer variable will raise an
overflow error.

HTH,
 
DSTDIVA3 said:
I am receiving an overflow error when this line is executed...

varSource = Nz(rstExcelRS.Fields(strIndexName).Value, -1)

The values are retrieved from a spreadsheet. The code was working fine
until it reached the value 38387. There isn't any calculations, so what
could be the problem? Do I need to set varSource back to 0 each time?


What type is varSource declared as? If it's Integer, than
that would be the cause and you should change it to Long.
 
Back
Top