"Hank" <ha********@aol.comwrote in message
<11*********************@i3g2000cwc.googlegroups.c om>:
>Doesn't the DecimalPlaces property give that?
Dim td As DAO.TableDef
Dim db As DAO.Database
Dim fd As DAO.Field
Set db = DBEngine(0)(0)
For Each td In db.TableDefs
For Each fd In td.Fields
If fd.Type = dbSingle Then
Debug.Print td.Name, fd.Name, _
fd.Properties("DecimalPlaces").Value
End If
Next fd
Next td
--
Roy-Vidar
Roy,
I tried your function and got "Property Not Found" for the
"DecimalPlaces" property. Actually it didn't recognize "Caption" or
other properties I thought should be there. I tried listing the
properties and found out that "DecimalPlaces" was number 23 but could
not get the value. I tried using fd.Properties(1) - (25) and got
values up to (8) but it would not recognize (9) and up.
As a test, I added a new table with singles in it and your
function reads it just fine. I tried to characterize the other
tables to see what the difference was but I could not find anything
significant.
Any ideas?
Hank
Some properties, like the Caption property, doesn't exist until they
are
set or created, either through the interface, or programatically. So,
those fields where you haven't set any caption, will return a 3270 -
property not found error.
For the Decimal Places property, it is a bit different. I think that if
you create the table through design view in Access, the property is set
regardless of whether you actually alter the value there or not. If you
on the other hand create the table through DDL, then it's not.
I don't work with these properties much programatically, but I think
that if your purpose is to just list the property values, I think that
you can safely assume that 3270 for the caption property, means no
caption is set, and for Decimal Places property for double/single
fields, then it's the default "Auto".
If you use on error resume next, and check for err.number = 3270, then
you should be able to determine which properties exists or not.
--
Roy-Vidar