DaveHa
asked on
Print text - viewmdb
Any idea about this?
Syntax:
Printer.Print Tab(5); "Fields:"
Printer.Print Tab(5); "------"
For Each fd In td.Fields
Printer.Print Tab(5); "["; Left(fd.Name + "]" + Space(20), 20) + Left(Str(fd.Size) + Space(5), 6) + typetable(fd.Type)
Printer.Print , " Description: "; fd.Properties("; Description; "); ""
Next fd
It should look like this:
Fieldname Fieldsize Datatype
---------- --------- ---------
CustomerID 4 Integer
Description:
Some description here for every field...
.....
Thanks for help!
/Dave
Syntax:
Printer.Print Tab(5); "Fields:"
Printer.Print Tab(5); "------"
For Each fd In td.Fields
Printer.Print Tab(5); "["; Left(fd.Name + "]" + Space(20), 20) + Left(Str(fd.Size) + Space(5), 6) + typetable(fd.Type)
Printer.Print , " Description: "; fd.Properties("; Description; "); ""
Next fd
It should look like this:
Fieldname Fieldsize Datatype
---------- --------- ---------
CustomerID 4 Integer
Description:
Some description here for every field...
.....
Thanks for help!
/Dave
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You should email me direct on this!
Mcrider, the Courier New font was selected earlier in the code...
M
Mcrider, the Courier New font was selected earlier in the code...
M
mark2150,
How do you know Courier New was selected earlier in the code? No reference was made in this question of it.
Cheers!
How do you know Courier New was selected earlier in the code? No reference was made in this question of it.
Cheers!
ASKER
Yes mcrider Courier New is selected earlier in the code.
Ok Mark!
Dave
Ok Mark!
Dave
mcrider,
Perhaps it's 'cause *I* wrote the ViewMDB program he's asking about...
M
Perhaps it's 'cause *I* wrote the ViewMDB program he's asking about...
M
For Each fd In td.Fields
Debug.Print Tab(5); "["; Left(fd.Name + "]" + Space(20), 20) + Left(Str(fd.Size) + Space(5), 6) + CStr((fd.Type))
Debug.Print , " Description: "; fd.Properties("description
Next fd
You should also have some error handling to allow for an error on the fd.properties.
Such as
Private Sub Command1_Click()
Dim accDB As Database
Dim td As TableDef
Dim fd As DAO.Field
Set accDB = OpenDatabase("c:\testbed\c
Set td = accDB.TableDefs("graphics"
Debug.Print Tab(5); "Fields:"
Debug.Print Tab(5); "------"
For Each fd In td.Fields
Debug.Print Tab(5); "["; Left(fd.Name + "]" + Space(20), 20) + Left(Str(fd.Size) + Space(5), 6) + CStr((fd.Type))
Debug.Print , " Description: "; GetFDProp(fd, "Description"); ""
Next fd
End Sub
Private Function GetFDProp(fdFieldDef As DAO.Field, strProperty As String)
On Error GoTo errProperty
strValue = fdFieldDef.Properties(strP
GetFDProp = strValue
Exit Function
errProperty:
strValue = "Property Value Unavailable"
Resume Next
End Function