Runtime error:6 Overflow

aman

Registered User.
Local time
Today, 09:54
Joined
Oct 16, 2008
Messages
1,251
Hi guys

I am getting above error message in the following red line of code:
Code:
Dim id As Integer
id = DMax("[ref]", "maintable")
[COLOR=darkred]id = id + 1[/COLOR]

CAn you tell me why this error is coming up?? This system has been used by the users for a year now and now this error message came up.. The ref field in the main table has Autonumber datatype and it has primary key on it.Presently the max value of ref is 32767. Is there any max value of Autonumber field in the table. Please help me in this.

Thanks
 
Check the "Id" field in the table.
if it is an "Autonumber" in Data Type,
then it must be a Long Integer in the Field Size.
But I see now, you put Id as integer,
put it as Long Integer.
 
Thanks a lot. I declared id as Long and it started working perfectly.

Thanks:)
 

Users who are viewing this thread

Back
Top Bottom