Compile Error "Can't Assign to read only property"

crystalsoft
crystalsoft used Ask the Experts™
on
Compile Error "Can't Assign to read only property"

Highlighted on

            !btno = RecvKKL!btno


Private Sub cmdMove_Click()
    
On Error Resume Next

    Command12.Enabled = False
    
    Option1.Enabled = False
    Option2.Enabled = False
    
    Moving_Rec (InputBox("Enter the Memo Number"))

End Sub


Private Sub Moving_Rec(lsno As Double)

'On Error GoTo NGPErrPara:
  
Dim RsCounter As New ADODB.Recordset
Dim BNo

Text1(18).text = lsno
  
''''''''''Connection For Mover.MDB file for transferring data from Trant.MDb to Mover.MDB
    If RecvKKL_Cnn.State = 1 Then RecvKKL_Cnn.Close
        RecvKKL_Cnn.Open "Provider=Microsoft.Jet.OLEDB.3.51;Data Source=" & App.Path & "\Mover.mdb;Jet OLEDB:Database Password=xxxxxxxxxxxxx"

'''''''''Local Recordset Connecting to B_Detail
    
    If RecvLCL.State = 1 Then RecvLCL.Close
        RecvLCL.Open "select * from B_Detail WHERE LsNo = " & Text1(18).text & " and Check = 1", con, adOpenKeyset, adLockOptimistic
        
        
    If RecvKKL.State = 1 Then RecvKKL.Close
        RecvKKL.Open "Select * from B_Detail", RecvKKL_Cnn, adOpenKeyset, adLockOptimistic

    If RecvKKL!btno > 0 Then
        BNo = RecvKKL!btno

        With RecvLCL
        
            .AddNew
        
            !btno = RecvKKL!btno
            !Mode = RecvKKL!Mode

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Expert of the Quarter 2010
Expert of the Year 2010

Commented:
Try changing it to

            RecvLCL!btno = RecvKKL!btno

Author

Commented:

now its highlighted on RecvLCL
Infotrakker Software
Most Valuable Expert 2012
Top Expert 2014
Commented:
Where is RecvLCL declared? I don't see it anywhere, but it may be a global variable. Has it been declared as an ADODB.Recordset?





Author

Commented:

OOPS

got it
it was .connection

i changed to .recordset and its working

But another problem appear..

and i ask new question...http://www.experts-exchange.com/Programming/Languages/Visual_Basic/Q_26305076.html

Author

Commented:

Thanks for quick reply

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial