ok.. I'm sticking my neck out , assuming u use ado or dao ... and want to create a report file.
this routine creates a report.txt file, where the fields are sep. with tabulator.
hope this can give you a push in the right direction.Code:Private Sub Command3_Click() Dim db As Database Dim s As String Dim rs As Recordset Dim SQL As String Dim sFile As String sFile = "C:\REPORT.TXT" SQL = "SELECT CompanyName, ContactName, ContactTitle FROM Customers" Set db = opendatabase("c:\demodb.mdb") Set rs = db.OpenRecordset(SQL) Open sFile For Output As #1 While Not rs.EOF 'add info from the fields that you want ' in this case the fields are sep. by tabulator Print #1, rs("CompanyName") & "" & vbTab & rs("ContactName") & "" & vbTab; rs("ContactTitle") & "" rs.MoveNext Wend Set db = Nothing Set rs = Nothing Close #1 End Sub
![]()




Reply With Quote