I am suspicious of this.....:
> Dim intFile As Integer
> intFile = FreeFile <<<<----this
> Open "\\eci-dzoflw13xtv\adi\test.txt" For Output As intFile <<<<---and
> this
........But I am not sure about it enough to suggest anything.
You could simplify the script a lot by just Dim'ing a single "strSQL" and
than dynamically concatinating the numerical digit on the end of "Select *
from Part1".
Like maybe:
---------------------------------------------------
Option Explicit
Dim i as Integer
Dim strSQL as String
Dim strSQLOutput as String
For i = 1 to 4 'Has 4 sections so loops 4 times
strSQL = "Select * from Part " & i
rs.Open strSQL, CurrentProject.Connection, adOpenDynamic,
adLockOptimistic
While Not .EOF '<<<---Loops the number of records in the Set
strSQLOutput = strSQLOutput & rs!Part '<<<---Adjust for that
somehow
rs.MoveNext
rs.Close
Wend
MsgBox ("Section " & i & " Complete...")
Next
Set rs = Nothing
-------------------------------------------------
It is off the top of my head and I'm sure it has errors to adjust for but
that gives the general idea.
This makes the script a *lot* shorter and easier to follow.
--
Phillip Windell [MCP, MVP, CCNA]
www.wandtv.com
"ToddRhodesECI" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hey guys. I have the following script: