need insert in recordset the array loop

User avatar
sal21
PlatinumLounger
Posts: 4355
Joined: 26 Apr 2010, 17:36

need insert in recordset the array loop

Post by sal21 »

I have this loop for next...

Code: Select all

 For I = 1 To ORS.Fields.Count - 1
        
        If Not IsNull(ORS(I)) Then
        TEST = ORS(I)
        End If
        
        Next I
i need (one a one) to insert druing the for next the related value of ORS(1) into the rs(0), ORS(2) into the rs(1)...ecc

note:
the fileds are exactlly the same number ORS and rs

Sorry Hans but peraphs i have just posted this question in other ( :grin: ) forum, but lost the link.

User avatar
HansV
Administrator
Posts: 78493
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: need insert in recordset the array loop

Post by HansV »

Does this do what you want?

Code: Select all

For I = 1 To ORS.Fields.Count - 1
  If Not IsNull(ORS(I)) Then
    rs(I - 1) = ORS(I)
  End If
Next I
Don't forget to save the record after the loop, using rs.Update
Best wishes,
Hans