i have code that loops through a recordset, and calls a function to write a line of data in a text file that was created. the function that is called has a vbcrlf at the end, so that the data will start on a new line each time.
the resulting text file has all the data correctly placed, with one exception, every few lines or so, there will be a completely blank line.
here's the code:
For lngrowcount = 0 To NumRecs - 1
Do While Not detailsrec.EOF
strproductrecord = Generate_Product_Record(True, False, lngproductcount, lngelementcount)
Loop
If strproductrecord <> "" Then
Print #refnum2, strproductrecord
End If
Next
Function Generate_Product_Record(ByVal boolbtnFlag As Boolean, ByVal boolFinalProduct As Boolean, ByVal lngproductcount As Long, ByVal lngelementcount As Long)
strproductrecord = strproductrecord & Left(lngcallid & Space(10), 10)
strproductrecord = strproductrecord & Left(lngordernumber & Space(10), 10)
strproductrecord = strproductrecord & Left(newrec("btn") & Space(10), 10)
strproductrecord = strproductrecord & vbcrlf
End Function
Does anyone know how i can prevent the blank lines from occurring?? I'd greatly appreciate any help!
the resulting text file has all the data correctly placed, with one exception, every few lines or so, there will be a completely blank line.
here's the code:
For lngrowcount = 0 To NumRecs - 1
Do While Not detailsrec.EOF
strproductrecord = Generate_Product_Record(True, False, lngproductcount, lngelementcount)
Loop
If strproductrecord <> "" Then
Print #refnum2, strproductrecord
End If
Next
Function Generate_Product_Record(ByVal boolbtnFlag As Boolean, ByVal boolFinalProduct As Boolean, ByVal lngproductcount As Long, ByVal lngelementcount As Long)
strproductrecord = strproductrecord & Left(lngcallid & Space(10), 10)
strproductrecord = strproductrecord & Left(lngordernumber & Space(10), 10)
strproductrecord = strproductrecord & Left(newrec("btn") & Space(10), 10)
strproductrecord = strproductrecord & vbcrlf
End Function
Does anyone know how i can prevent the blank lines from occurring?? I'd greatly appreciate any help!