Results 1 to 1 of 1

Thread: Easy Overflow Problem [RESOLVED]

Threaded View

  1. #1

    Thread Starter
    Fanatic Member JCScoobyRS's Avatar
    Join Date
    Oct 2002
    Location
    Some Mountain in Colorado
    Posts
    677

    Easy Overflow Problem [RESOLVED]

    Here is the code:

    VB Code:
    1. If ItemRec2!IM_PROD_CODE = "M" Then
    2.         Dim PPS As Double
    3.         Dim SC As Long
    4.         If ItemRec!PS_QTY_P = 0 Then
    5.             PPS = 1
    6.         Else
    7.             PPS = 1 / ItemRec!PS_QTY_P
    8.         End If
    9.         If txtQuantity(lngVvIndex).Text < PPS Then
    10.             SC = 1
    11.         Else
    12.             [b]SC = CInt(((txtQuantity(lngVvIndex).Text + 2) / PPS) + 0.49)[/b]
    13.         End If
    14.         txtMaterial(lngVvIndex).Text = txtMaterial(lngVvIndex).Text + ((SC * ItemRec2!IM_COST) / txtQuantity(lngVvIndex).Text)
    15. End If

    Can someone tell me why I'm getting an overflow error in the bolded line with the "txtQuantity(lngVvIndex).Text = 100,000"? Thanks, Jeremy

    So easy I figured it out. CInt should be CLng
    Last edited by JCScoobyRS; Apr 2nd, 2003 at 12:42 PM.
    He who listens well, speaks well.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width