Overflow?

  • Thread starter Thread starter Nathan Sanders
  • Start date Start date
N

Nathan Sanders

Hi,

Given the following code, why am I getting an overflow error on the
highlighted line?

Please help.

Private Sub Command21_Click()

Dim txtdata As Recordset
Dim dbs As Database
Dim strsql As String
Dim trnval As Integer
Dim trncount As Integer
Dim hashtot As Integer

Set dbs = CurrentDb
strsql = _
"SELECT * from credfile"
Set txtdata = dbs.OpenRecordset(strsql)


Open "parktest.pc2" For Output As #1

Write #1, _
1, _
1, _
530, _
361575, _
0, _
2, _
2, _
, _
"park auto services"

Do Until txtdata.EOF
Write #1, _
2, _
txtdata!bank, _
txtdata!brch, _
txtdata!bacct, _
txtdata!suffix, _
52, _
txtdata!pay, _
txtdata!name, _
txtdata!glcode, _
txtdata!glcode, _
txtdata!glcode, _
txtdata!glcode, _
"caltex trentham", _
txtdata!acct, _
txtdata!acct, _
txtdata!acct
txtdata.MoveNext
Loop

trnval = DSum("pay", "credfile") 'THESE THREE LINES CAUSE
ERROR 6 OVERFLOW
trncount = DCount("pay", "credfile") '
hashtot = DSum("bacct", "credfile") '

Write #1, _
3, _
trnval, _
trncount, _
hashtot

Close #1


End Sub
 
Thanks guys,

that is the answer.

--
Kind Regards

Nathan J Sanders
Director
############################################################################
###################################################
Park Auto Services (1997) Limited
PO Box 47-124
Trentham
Upper Hutt

Ph 64-4-528-2210
Ph 64-4-528-8883
Fx 64-4-527-7184
Mob 027-230-6220
EMail (e-mail address removed)


 
Back
Top