overflow error

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
 
G

Guest

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
 
K

Ken Ivins

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top