plz can you help me, with this code?
The loop doesn't want to work. My table containts 300 records, so the code must generate 300 txt files, with different names. I tried it in ACCESS 97 & 2002, but i still keep the problem.....
thank you in advance.
***********************
Dim dbs As DAO.Database
Dim name As String
Dim funct As String
Dim rs As DAO.Recordset
Dim strfile As String
Set dbs = CurrentDb
Set rs = dbs.OpenRecordset("adrmp", dbOpenForwardOnly)
funct = rs.Fields("adr010")
name = rs.Fields("adr020")
Do
strfile = "c:\test\" & name & ".txt"
Open strfile For Output As #1
Print #1, naam
Close #1
rs.MoveNext
Loop Until rs.EOF
The loop doesn't want to work. My table containts 300 records, so the code must generate 300 txt files, with different names. I tried it in ACCESS 97 & 2002, but i still keep the problem.....
thank you in advance.
***********************
Dim dbs As DAO.Database
Dim name As String
Dim funct As String
Dim rs As DAO.Recordset
Dim strfile As String
Set dbs = CurrentDb
Set rs = dbs.OpenRecordset("adrmp", dbOpenForwardOnly)
funct = rs.Fields("adr010")
name = rs.Fields("adr020")
Do
strfile = "c:\test\" & name & ".txt"
Open strfile For Output As #1
Print #1, naam
Close #1
rs.MoveNext
Loop Until rs.EOF