Runtime error:6 Overflow (1 Viewer)

aman

Registered User.
Local time
Today, 04:09
Joined
Oct 16, 2008
Messages
1,250
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
 

MStef

Registered User.
Local time
Today, 12:09
Joined
Oct 28, 2004
Messages
2,251
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.
 

aman

Registered User.
Local time
Today, 04:09
Joined
Oct 16, 2008
Messages
1,250
Thanks a lot. I declared id as Long and it started working perfectly.

Thanks:)
 

Users who are viewing this thread

Top Bottom