-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmodTableInfo.bas
More file actions
69 lines (40 loc) · 1.14 KB
/
Copy pathmodTableInfo.bas
File metadata and controls
69 lines (40 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
Attribute VB_Name = "modTableInfo"
Option Compare Database
Sub ListTableFields(TableName As String)
Dim db As Database
Dim tdf As TableDef
Dim fld As Field
Set fs = CreateObject("Scripting.FileSystemObject")
Set txtFile = fs.CreateTextFile("C:\Users\robf\Documents\ListTables.txt", True)
Set db = CurrentDb
Set tdf = db.TableDefs(TableName)
txtFile.WriteLine (TableName)
Debug.Print TableName
For Each fld In tdf.Fields
txtFile.WriteLine (fld.Name & "," & FieldType(fld.Type))
Debug.Print fld.Name & "," & FieldType(fld.Type)
Next
txtFile.Close
Set tdf = Nothing
Set db = Nothing
End Sub
Function FieldType(IntegerType As Integer) As String
Select Case IntegerType
Case dbBoolean
FieldType = "Boolean"
Case dbCurrency
FieldType = "Currency"
Case dbDate
FieldType = "Date"
Case dbInteger
FieldType = "Integer"
Case dbLong
FieldType = "Long Integer"
Case dbMemo
FieldType = "Memo"
Case dbNumeric
FieldType = "Numeric"
Case dbText
FieldType = "Text"
End Select
End Function