The following ADO code might help!
It prints the table name and field names to the immediate window.
Pass it a table name as a parameter.
Sub FieldList(table As String)
Dim rst As Recordset
Dim dbs As Database
Dim counter As Long
Dim strName As String
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset(table)
Debug.Print table & Chr(13) & Chr(10)
With rst
.MoveLast
Debug.Print "Records: " & CStr(.RecordCount)
For counter = 1 To .Fields.count
strName = .Fields(counter - 1).Name
If InStr(strName, " ") Then
strName = "[" & strName & "]"
End If
Debug.Print strName
Next
End With
Set dbs = Nothing
Set rst = Nothing
End Sub
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only