boye-i Level: Scholar
 Registered: 22-10-2002 Posts: 43
|
Runtime Error: 3704
Hi,
Whenever I run the following code I recieve the following message:
"Runtime Error: 3704 The Operation requested by the application is not allowed if the object is closed."
at the .AddNew line. This is how the code flows:
General Declaration()
Dim mrstBalanceSheet As Recordset
Dim cn As ADODB.Connection
----------------------
Form_Load()
Set mrstBalanceSheet = New Recordset
cn.ConnectionString = "dsn=cmis"
cn.Open
--------------------------
Command1_Click()
Set mrstBalanceSheet = cn.Execute("Delete * from BalanceSheet")
'Preparing For The Balance Sheet Table
'INCOME
k = 0
With rstBalanceSheet
For i = 0 To ctrT -1
If AccountCartegory(i) = "INCOME" Then
.AddNew
!AccountTypeI = AccountType(i)
!AmountI = AccountTotal(i)
.Update
End If
Next i
End With
How do I solve this please?
____________________________
IKBoye
|