View Full Version : How to display Decimal places using VBA


Leen
06-13-2007, 12:15 AM
Hi,

I'd like to create a table using VBA where one of the fields is a number datataype, the fieldsize property is double.

.Fields.Append .CreateField("LENGTH", dbDouble)

However, I'd like tthat that, when values are inserted in this tablefield, 7 decimal places are displayed. I know you can set it manual in the design view of the table (in the tab general - decimal places), but i'd like to do this automatically when creating the table?

In the help I found under DecimalPlaces Property:
"Note You can set this property for text boxes and combo boxes by using the control's property sheet and for table fields by using the table's property sheet. You can also set this property in the Field Properties property sheet in query Design view"

Does that means it can't be set while creating the table?

Thanks for any help!
Leen

gemma-the-husky
06-13-2007, 01:44 AM
there's probably another field attribute for display decimals you can set in a similar way

RoyVidar
06-13-2007, 01:50 AM
Check out this sample from Allen Browne http://allenbrowne.com/func-DAO.html#StandardProperties which utilizes his SetPropertyDAO on the same page (just above).