Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Overflow at 45783 records???!! 2

Status
Not open for further replies.

Russie

Programmer
Dec 24, 2000
104
US
Hi.

I'm using....

Public Function countOutstandingCashbook() As Integer

countOutstandingCashbook = DCount("[Date]", "tblCashbook", "")

End Function

...to count the number of records in my tblCashbook table, which has 45783 records in it (standard stuff).

I get 'Runtime Error 6 Overflow' in response, which I find odfd as 45K may be a lot of records but I wouldn't have thought that it would give Access a problem.

Any ideas as to why this should happen?? Any ideas for a fix?

Anything Appreciated.

Regards

Russie

 
Hallo,

Do you get the same error if you use "*" rather than "[Date]" in your DCount function call?

- Frink
 
What JohnYingling is suggesting is that you not use an integer to count anything which could possibly be greater than 32767. That is easily accomplished by using a long variable which, and I don't feel like looking it up, can store numbers in the multiple millions.

Public Function countOutstandingCashbook() As Long

countOutstandingCashbook = DCount("[Date]", "tblCashbook", "")

End Function
-------------------------------------
scking@arinc.com
Try to resolve problems independently
Then seek help among peers or experts
But TEST recommended solutions
-------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top