Home > Software engineering >  O the Rs. ActiveConnection=CurrentProject. Connection error, why?
O the Rs. ActiveConnection=CurrentProject. Connection error, why?

Time:09-22

Public fill Sub balance fill ()
Dim the Db As ADODB. Connection, varbalance As Double
Dim the Rs As you
Set the Db=New ADODB. Connection
Set the Rs=New ADODB. You
Rs. The ActiveConnection=CurrentProject. Connection -- -- -- -- -- -- -- -- -- -- -- -- the tip error: methods and data members not found
On Error GoTo Error type
Rs. Open "bank deposit", adopenkeyset, adlockoptimistic, adcmdtable
Varbalance=0
EOF
Do Until the Rs.Rs. CancelUpdate
Rs (" balance ")=Rs! Deposit - Rs! Withdrawals + varbalance
Rs. Update
Varbalance=Rs! The balance
Rs. MoveNext
Loop
Rs. Close
MsgBox "balance has mended the for you, don't need to own calculation of"
DoCmd. SelectObject acTable, "bank deposit", True
DoCmd. OpenTable "bank deposit", acViewNormal acEdit
DoCmd. GoToControl "balance"
Error:
If Err. Number & lt;> 0 Then
MsgBox "error message:" & amp; Err, Description & amp; "Error code" & amp; Err. Number
End the If
The Exit Sub
End Sub


Run to the row 6 errors
Rs. The ActiveConnection=CurrentProject. Connection -- -- -- -- -- -- -- -- -- -- -- -- the tip error: methods and data members not found
Could give tips do ah, I estimate is for engineering has a reference without hook, but I don't know is which ah, seek expert advice, thanks!

CodePudding user response:

Themselves on the Internet to find the other solution:
Dim the Db As Object
Dim varbalance As Double
Dim the rs As Object
Set the Db=CreateObject (" ADODB. Connection ")
Set the rs=CreateObject (" ADODB. You ")
Rs. The ActiveConnection=CurrentProject. Connection
So you can run

CodePudding user response:

Dim the rs as the adodb library you
Have a try
  • Related