Error 6 Overflow

mfaqueiroz

Registered User.
Local time
Today, 08:07
Joined
Sep 30, 2015
Messages
125
Hi!
I'm stuck with this error : error 6:Overflow I've serch for this and the solutions are pretty similar : set the variable as long and use the Clng, I have did that however the error persists.
There is my code,

Dim End as Long

Set dbs = DBEngine(0)(0)
Set TABLE1= dbs.OpenRecordset("input",db_open_dynaset)

End= CLng( DDcount("ID","Input"))

For x=1 to (End-1)





Any suggestion?
:)
Thank yoou!!
 
What is X declared as? Could the count be zero?
 
is the count of the records
starts with 1

after that i have something like
x=1+x
 
I understand. What value is being returned as the count, and what is X declared as?
 
it's working!! i only closed the access and re open and the error dissapeared
 
Why do you have
after that i have something like
x=1+x

doesn't a For loop auto-increment on its own ?

For x =1 to (End-1)
do stuff
Next x
 
Also someone mentioned that "End" may be a reserved word.
I always write variables starting with the type of it.
So
Code:
Dim End as Long
would be
Code:
Dim lEnd as Long[code]
(strVariable, bIsOk, iNumber) that way you don't get in trouble with reserved words.

Others here probably has other methods to do so.
 

Users who are viewing this thread

Back
Top Bottom