Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report That Prints Table Headers.

Status
Not open for further replies.

theif68

Technical User
Apr 3, 2005
39
US
I need to be able to bring in any type of file in access, and print a field layout, quick and easy. Is there a way to do this.

Example:

Field1 1 30
Field2 31 60
Field3 61 90
 
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.
 
Import is not the issue: I need a physical report to print the field layouts.

Example:
Field Name Start End
Field1 1 30
Field2 31 60
Field3 61 90
 
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.
 
What do you mean by "Start" and "End"? A field may have a set length, but what does start and end represent?
 
Is this something like you want.

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



Your output looks like this

autoPersonnelID 4
txtSSN 11
strFirstName 50
strLastName 50
strMiddleInitial 10

Instead of printing to the immediate window you would save to a table and you could either make a report from the table.
 
That is exaclty what I need but not getting it to work. Thought I did. Sorry..

How do I use this on a table called "tblStandardLayout" ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top