Hello all,
Here is my question...
I have a loop in my access module that loops through orders and outputs some XML for each. I am having trouble getting the file output to work correctly. Here is a little code snippet of what I'm doing (with most of the code removed):
For i = 1 To 3
Open TempPath & "xmldef.xml" For Output As #1
Print #1, "whatever"
Close #1
FileCopy TempPath & "xmldef.xml", OtherPath & "xmldef.xml"
Kill TempPath & "xmldef.xml"
next i
With the code as it stands, when it loops and hits the open statement for the second time, it gives a "File already open." If I don't close the file and I try to copy it, it gives me a "File not closed" error. If I try write to the file without opening it again for the second iteration, it gives me a "file not open" error. So what am I supposed to do?
Thanks in advanced for any help you can provide.
-XolloX
Here is my question...
I have a loop in my access module that loops through orders and outputs some XML for each. I am having trouble getting the file output to work correctly. Here is a little code snippet of what I'm doing (with most of the code removed):
For i = 1 To 3
Open TempPath & "xmldef.xml" For Output As #1
Print #1, "whatever"
Close #1
FileCopy TempPath & "xmldef.xml", OtherPath & "xmldef.xml"
Kill TempPath & "xmldef.xml"
next i
With the code as it stands, when it loops and hits the open statement for the second time, it gives a "File already open." If I don't close the file and I try to copy it, it gives me a "File not closed" error. If I try write to the file without opening it again for the second iteration, it gives me a "file not open" error. So what am I supposed to do?
Thanks in advanced for any help you can provide.
-XolloX