I am using ADODB.Recordset in my vba program, loading all record from table to recordset and want to filter record inside the loop based on loop(i value).
I am using below code to filter record from recordset:
for (dim i as integer = 1 to 10)
rsContacts.Filter = "Name = '" & Cell(i,1) & "' and Id = '" & Cell(i,2)& "'"
next
It's filtering properly returning one record when i = 1 but when i = 2 recordset doesn't have any record. How can filter record but want to keep full recordset so that it will filter properly?
for (dim i as integer = 1 to 10)is a syntax error in VBA.