-
Can someone plz tell me what is the problem with this code?
What it's doing is taking each value in a particular
database field and parsing a text file for it line by line.
If it finds it, it executes some code and continues searching the text file. When it gets to the end of the text file, it should move to the next record in the
database. But what is happening is it's jumping from the
for strValue = recordset!field line right to the next j
rsCount is already determind prior to this and it's the
count of the records in the recordset (it is a valid number
by the way)
Code:
For i = 1 To RecordsetsThatImRunningThrough
recordset.MoveFirst
Open File.txt for append as #1
For j = 1 To rsCount
strValue1 = recordset!Field
Do While Not EOF(1)
'My Code Here
Loop
recordset.MoveNext
Next j
Close #1
Next i
Thanks for the help
-
mistake
the 'for i' loop is a loop of a couple of different recordsets
while the 'for j' loops through the individual recorset
sorry for the confusion
-
rscount?
Code:
For j = 1 To rsCount
It looks to me as if rscount is not initialized. If it is zero when the For-Loop starts, you will skip to the Next.