hello
i receive a runtime error '2465' whenever i run my module in access
97. it says
'Run-time error '2465'
OOB Reports can't find the field "DuplicatePayments' referred to in
your expression.
You may have misspelled the field name or the field may have been
renamed or deleted.'
however i checked the tables i have referred in the following module.
any advise would be greatly appreciated.
thanks! jmcn
Public Sub RecoCleaner()
Dim loop1 As Long
Dim dummy As String
Dim numloans As Long
Dim loopy As Long
Dim spot As Long
Dim accnum As String
Dim intnum As String
Dim CashBal As String
Dim totalbucket As String
Dim cashrecv As String
Dim securecv As String
Dim totalunpr As String
Dim futuredue As String
Dim duplicatepay As String
Dim lumpcash As String
Dim diff As String
Dim x As Long
Dim recox As Long
Dim data(90000, 12) As String
Dim SSQL As String
Dim db As String
Dim numloans2 As Integer
Dim a As Variant
Dim notfound As Long
Dim dbs As Database
Dim rstOrders As Recordset, rstSorted As Recordset
Set dbs = CurrentDb
'Open Reco33 info into form
DoCmd.OpenForm "frmRECO33OOB"
Forms!frmRECO33OOB.Requery
'Count records
recox = DCount("*", "RECO33OOB")
numloans = 0
spot = 1
'Populate desired info into data array
DoCmd.GoToRecord acForm, "frmRECO33OOB", acFirst
Do Until spot >= recox
DoCmd.GoToRecord acForm, "frmRECO33OOB", acGoTo, spot
If Forms![frmRECO33OOB]![Field1] = " LOAN ACCOUNT" Then
spot = spot + 5
DoCmd.GoToRecord acForm, "frmRECO33OOB", acGoTo, spot
'Check to make sure the loan didn't bomb
If Forms![frmRECO33OOB]![Field1] <> " Loan ignored" Then
spot = spot - 3
DoCmd.GoToRecord acForm, "frmRECO33OOB", acGoTo, spot
numloans = numloans + 1
accnum = Forms![frmRECO33OOB]![Field1]
intnum = right$(Forms![frmRECO33OOB]![Field3], 6)
spot = spot + 2
DoCmd.GoToRecord acForm, "frmRECO33OOB", acGoTo, spot
CashBal = Forms![frmRECO33OOB]![Field2]
spot = spot + 2
DoCmd.GoToRecord acForm, "frmRECO33OOB", acGoTo, spot
totalunpr = Forms![frmRECO33OOB]![Field4]
lumpcash = Forms![frmRECO33OOB]![Field5]
spot = spot + 1
DoCmd.GoToRecord acForm, "frmRECO33OOB", acGoTo, spot
futuredue = Forms![frmRECO33OOB]![Field4]
totalbucket = Forms![frmRECO33OOB]![Field2]
spot = spot + 2
DoCmd.GoToRecord acForm, "frmRECO33OOB", acGoTo, spot
cashrecv = Forms![frmRECO33OOB]![Field2]
duplicatepay = Forms![frmRECO33OOB]![Field4]
spot = spot + 1
DoCmd.GoToRecord acForm, "frmRECO33OOB", acGoTo, spot
securecv = Forms![frmRECO33OOB]![Field2]
diff = Forms![frmRECO33OOB]![Field5]
data(numloans, 1) = accnum
data(numloans, 2) = intnum
data(numloans, 3) = CashBal
data(numloans, 4) = totalbucket
data(numloans, 5) = cashrecv
data(numloans, 6) = securecv
data(numloans, 7) = totalunpr
data(numloans, 8) = futuredue
data(numloans, 9) = duplicatepay
data(numloans, 10) = right$(lumpcash, 16)
data(numloans, 11) = right$(diff, 16)
End If
End If
If spot <= recox Then
spot = spot + 1
End If
Loop
'Populate new Table with Clean data
DoCmd.OpenForm "frmCleanData"
For x = 1 To numloans
Forms![frmCleanData]![LoanAccount].Value = Trim$(data(x,
1))
Forms![frmCleanData]![Internal].Value = Trim$(data(x, 2))
Forms![frmCleanData]![CashBal].Value = Trim$(data(x, 3))
Forms![frmCleanData]![totalbucket].Value = Trim$(data(x,
4))
Forms![frmCleanData]![CashReceivables].Value =
Trim$(data(x, 5))
Forms![frmCleanData]![SecuReceivables].Value =
Trim$(data(x, 6))
Forms![frmCleanData]![totalunpr].Value = Trim$(data(x, 7))
Forms![frmCleanData]![FutureDueItems].Value =
Trim$(data(x, 8))
'runtime error '2465'
Forms![frmCleanData]![DuplicatePayments].Value = Trim$(data(x, 9))
Forms![frmCleanData]![lumpcash].Value = Trim$(data(x, 10))
'runtime error '2465' too...
Forms![frmCleanData]![Differences].Value = Trim$(data(x, 11))
If x <> numloans Then
DoCmd.GoToRecord acForm, "frmCleanData", acNewRec
End If
Next x
' Create dynaset-type Recordset object.
Set rstOrders = dbs.OpenRecordset("Clean Data", dbOpenDynaset)
' Set sort order.
rstOrders.Sort = "LoanAccount"
DoCmd.Close
End Sub