1)What do you really mean by any type of file? Text file, CSV, Excel, Word Document, etc.?
2)What part are you having problem with? Import the file, file picker, report generation?
3)What information do you want printed? Field Name, size, datatype, caption etc.?
Most likly the file will be either excel or tab delimited and imported into a database. I need to generate a report of the field names and lengths, but there could be 100 fields so manually this would take hours.
Usually when you import excel the program will ask if the first row is the header. Now with the tab delimited you can set up a specification that will add the headers name for the file into a new table. Or you can set up a table that have the header already and created specification right before you import the file. Then next time all you would have to do is select the correct specification.
Creating a report that will display the data the way you want, then you could send it out in snapshot, excel, of tab delimited. With tab delimited you would have to set up the specification.
Public Sub fieldProperties(strTableName As String)
Dim rs As DAO.Recordset
Dim fld As DAO.Field
Set rs = CurrentDb.OpenRecordset(strTableName)
For Each fld In rs.Fields
Debug.Print fld.Name & " " & fld.Size
Next fld
End Sub
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.