Code no longer working - Overflow error

  • Thread starter Thread starter toukey1
  • Start date Start date
T

toukey1

I have VB code on a form which updates a table based on certain
criteria. This form has been working properly for years however
recently I am unable to get pass the the line beginning with 'sno' as I
am getting an 'overflow' error. The criteria is a match and I have no
idea what is causing it. The first time it occurred I recreated the
table the code is updating and copied the records into it. It worked
fine for a week or so and then it occurred again needless to say I
tried recreating the table but still got the error.

add2 = " And [tblAllPols].[PolicyNo] = '" & vary & " ' "
add3 = " And [tblAllPols].[Premium] = " & varz
add4 = " And [tblAllPols].[ClientNo] = " & xx
vno = " And [tblAllPols].[InvNo] = 0"

sno = DLookup("[SeqNo]", "tblAllPols", "[tblAllPols].[Issuedate] = # "
& vard & " #" & vno & add2 & add3 & add4)
If sno = 0 Then
mes3 = MsgBox("Please check your information!", vbOKOnly)

Any help would be greatly appreciated.
 
Anything dim'ed as an integer or byte? How about the data at table level?

If the numbers get over 255 for a byte or a little over 32,000 for an
integer, overflows can happen.
 

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

Back
Top