Lo all,
Im making a program which works fine while in development running (ie pressing f5 while coding) but when I turn it into an .exe I get an error where I didnt get one previously. Does anyone have any ideas?? Heres the code throwing up the error.

VB Code:
  1. Public Function DoubleClick(Socket As Integer, rcvData() As Byte)
  2.     On Error GoTo Error_Handle
  3.     Dim Target As Long, mItem As TypeItem
  4.     Target = GetTarget(rcvData, 1)
  5.     If Target = -1 Then Exit Function
  6.     If Target <= UBound(Character) Then
  7.         If Character(Target - CharSerialOffset).CharacterType = CTPlayer Or CTVendor Then
  8.             Paperdoll Socket, Target - &H80000000
  9.         End If
  10.         If Character(Target - CharSerialOffset).CharacterType = CTMount Then
  11.             If CheckIfLayerInuse(Client(Socket).Serial, LMount) = True Then
  12.                 Exit Function
  13.             Else
  14.                 Character(Target).Flag.Invisible = True
  15.                 Character(Target).Flag.Frozen = True
  16.                 With mItem
  17.                     .Amount = 1
  18.                     .ParentSerial = Client(Socket).Serial
  19.                     .Name = "a mount"
  20.                     .CurrentLocation = Character(Client(Socket).Serial).CurrentLocation
  21.                     .ItemID = Character(Target).TameDetails.MountID
  22.                     .Hue = Character(Target).SkinHue
  23.                     .Layer = 25
  24.                     .Owner = Client(Socket).Serial
  25.                     .Misc = Target
  26.                     .Serial = UBound(Item) + 1 + ItemSerialOffset
  27.                 End With
  28.                 AddItembyInfo mItem
  29.                 UpdateItem (UBound(Item) + ItemSerialOffset)
  30.                 UpdateInRangeNPC (Target)
  31.             End If
  32.         End If
  33.     Else
  34.         If Character(Client(Socket).Serial).Flag.Dead = True Then
  35.             If Server.Era < AOS Then
  36.                 'Send 'I am dead and cannot do that.'
  37.             Else
  38.                 Cliloc Socket, Client(Socket).Serial, 0, 3000061, AbovePlayer
  39.             End If
  40.             Exit Function
  41.         Else
  42.             If Item(Target - ItemSerialOffset).ItemType = ITContainer And IsInRange(Client(Socket).Serial, Target - ItemSerialOffset, 3, True) = True And Item(Target - ItemSerialOffset).Gump > 0 Then
  43.                 If Item(Target - ItemSerialOffset).ParentSerial = 0 Or Client(Socket).Serial Then
  44.                     If IsInRange(Client(Socket).Serial, Target - ItemSerialOffset, 3, True) = True And IsItemInview(Client(Socket).Serial, Target - ItemSerialOffset) = True Then
  45.                         ShowContainer Socket, (Target)
  46.                     Else
  47.                         If Server.Era < AOS Then
  48.                             'Send 'I can't reach that.'
  49.                         Else
  50.                             Cliloc Socket, Client(Socket).Serial, 0, 1019045, AbovePlayer
  51.                         End If
  52.                     End If
  53.                 Else
  54.                     'If IsInRange(Client(Socket).Serial, (Target - ItemSerialOffset), 1, True) Then useskill Socket, Snooping, Target
  55.                 End If
  56.             End If
  57.         End If
  58.     End If
  59.     Exit Function
  60. Error_Handle:
  61.     frmMain.lstStatus.AddItem "WARNING: Double Click Error. Crash caused with error(" & Err.Description & ")" & Err.Source
  62.     frmMain.lstStatus.ListIndex = frmMain.lstStatus.ListCount - 1
  63. End Function

The error im getting is an 'overflow' error, I dont know where its occuring as no error is thrown up if I do step through or run from vb6 play button/f5. The error only occurs when I run the .exe after a full compile. Any ideas??