overflow error

  • Thread starter Thread starter Ken Ivins
  • Start date Start date
K

Ken Ivins

I want to auto fill a field CheckNo when I create a new record with the next
check number. I have a Table tblChecks with the check numbers (CheckNo field
as a Number-I'm modifying someone else's work), amounts etc.

I event created a query [qryCheckNum-recent] that shows the last check
number (using the "Max" total).

I tried below and got a Run Time error '6' Overflow


Dim intCkNum As Integer

intCkNum = DLookup("[CheckNo]", "qryCheckNum-recent")
intCkNum = intCkNum + 1

Me.CheckNo = Nz(Me.CheckNo, intCkNum)

Please help me figure out what I am doing wrong. Any ideas are always
welcome.

Thanks,
Ken
 
What the size of the max CheckNo, it might be bigger the integer.
You get the overflew message when you trying to insert a bigger amount then
you can enter in the specific data type.

Try and change it to double
Dim intCkNum As Double
 
Dear Ofer,

Thanks, that did it.

Ken




Ofer said:
What the size of the max CheckNo, it might be bigger the integer.
You get the overflew message when you trying to insert a bigger amount
then
you can enter in the specific data type.

Try and change it to double
Dim intCkNum As Double

Ken Ivins said:
I want to auto fill a field CheckNo when I create a new record with the
next
check number. I have a Table tblChecks with the check numbers (CheckNo
field
as a Number-I'm modifying someone else's work), amounts etc.

I event created a query [qryCheckNum-recent] that shows the last check
number (using the "Max" total).

I tried below and got a Run Time error '6' Overflow


Dim intCkNum As Integer

intCkNum = DLookup("[CheckNo]", "qryCheckNum-recent")
intCkNum = intCkNum + 1

Me.CheckNo = Nz(Me.CheckNo, intCkNum)

Please help me figure out what I am doing wrong. Any ideas are always
welcome.

Thanks,
Ken
 
Back
Top