Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB6 - Refrerenced memory at 0x0000000c could not be "read"

Status
Not open for further replies.

bodlela

Programmer
Oct 22, 2009
45
MZ
Hi all

My VB6 program made to enter PO Invoices from RCP form is returning "Referenced memory at 0x0000000c could not be read" error on line << PORCP1header.Update >>. This was working in A4W 55A. I just changed it to point to A4W 60A.
Please help me figuring out what is wrong in my code.

Code:
With rsTrans
        While (Not .EOF)
                       
            PORCP1header.Order = 1
            PORCP1header.Order = 0
            
            PORCP1headerFields("RCPHSEQ").PutWithoutVerification ("0")            ' Receipt Sequence Key
            
            temp = PORCP1header.Exists
            PORCP1header.Init
            PORCP1header.Order = 1
            temp = PORCP1detail1.Exists
            PORCP1detail1.RecordClear
            temp = PORCP1detail3.Exists
            PORCP1detail3.RecordClear
            temp = PORCP1detail4.Exists
            PORCP1detail4.RecordClear
            temp = PORCP1detail6.Exists
            PORCP1detail6.Init
            temp = PORCP1detail2.Exists
            PORCP1detail2.Init
            PORCP1headerFields("RCPNUMBER").Value = !RCPNUMBER                ' Receipt Number
            temp = PORCP1header.Exists
            PORCP1header.Read
            temp = PORCP1detail6.Exists
            PORCP1detail6.Init
            
            PORCP1detail6Fields("RCPRREV").PutWithoutVerification ("-999999999999999999")   ' Line Number
            
            PORCP1detail6.Browse "", 1
            PORCP1detail6.Fetch
            temp = PORCP1detail2.Exists
            PORCP1detail2.Init
            
            PORCP1detail2Fields("RCPCREV").PutWithoutVerification ("-999999999999999999")   ' Comment Identifier
            
            PORCP1detail2.Browse "", 1
            PORCP1detail2.Fetch
            PORCP1detail3.Browse "(RCPHSEQ = " & !RCPHSEQ & ")", 1
            temp = PORCP1detail3.Exists
            PORCP1detail3.RecordClear
            PORCP1detail3.Browse "(ISPRIMARY = ""0"")", 1
            PORCP1headerFields("INVNUMBER").Value = !NEWINVNUM                   ' Invoice Number
            PORCP1detail3.Browse "", 1
            
            PORCP1detail3Fields("VDCODE").PutWithoutVerification ("")             ' Vendor
            PORCP1detail3.Browse "(RCPHSEQ = " & !RCPHSEQ & ")", 1
            temp = PORCP1detail3.Exists
            PORCP1detail3.RecordClear
            PORCP1detail5Fields("FUNCTION").PutWithoutVerification ("10")         ' Function
            PORCP1detail5.Process
            temp = PORCP1header.Exists
            PORCP1header.Update
            'PORCP1detail5Fields("RCPHSEQ").PutWithoutVerification ("'" & !RCPHSEQ & "'")    ' Receipt Sequence Key
            PORCP1detail5Fields("RCPHSEQ").Value = !RCPHSEQ ' Receipt Sequence Key
            PORCP1detail5Fields("FUNCTION").PutWithoutVerification ("2")          ' Function
            
            PORCP1detail5.Process
            PORCP1header.Read

            Trfnr = Trfnr & "; " & !NEWINVNUM
            .MoveNext
        Wend
    End With 'rs
Thanks

 
All those junk "temp = " lines indicates this is a recorded macro. Record another in version 6.0, you'll see different functions and .Compositions.
 
And be very careful about changing the .order of a view that you're going to use to .post with.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top