Hello everyone, after browsing and browsing for a solution to the {most likely simple] issue below, I decided to throw in the towel and ask those
more versed in Access. So, the issue I have is very basic. I have a table with 6 fields, the first is a date and the rest "doubles". Now, this table has been
created with VBA code and it works just fine. But when I open the table the numeric fields have decimal places all over the place. For example, 32.345, 42.1, 54.25 etc...I would like them to appear neatly, with a fixed number of decimal places, say 3, in which case I should see 32.345, 42.100 and 54.250.
Of course, I can manually do this in the Access file with the design view, but the issue is that I have about 2000 such accdb files.
I tried something like this, but to no avail (RS_DATA is the recordset, SZ_SQL the query that selects the values in the table).
RS_DATA.Open SZ_SQL, RS_CON, adOpenStatic, adLockOptimistic, adCmdText
For K = 0 To (RS_DATA.Fields.Count - 1)
With RS_DATA.Fields(K)
Debug.Print .Name, .Type
If .Type = adDouble Then
.Properties("decimalplaces") = 3 '---> here I an just stuck.
End If
End With
Next K
Thank you for your thoughts!!
more versed in Access. So, the issue I have is very basic. I have a table with 6 fields, the first is a date and the rest "doubles". Now, this table has been
created with VBA code and it works just fine. But when I open the table the numeric fields have decimal places all over the place. For example, 32.345, 42.1, 54.25 etc...I would like them to appear neatly, with a fixed number of decimal places, say 3, in which case I should see 32.345, 42.100 and 54.250.
Of course, I can manually do this in the Access file with the design view, but the issue is that I have about 2000 such accdb files.
I tried something like this, but to no avail (RS_DATA is the recordset, SZ_SQL the query that selects the values in the table).
RS_DATA.Open SZ_SQL, RS_CON, adOpenStatic, adLockOptimistic, adCmdText
For K = 0 To (RS_DATA.Fields.Count - 1)
With RS_DATA.Fields(K)
Debug.Print .Name, .Type
If .Type = adDouble Then
.Properties("decimalplaces") = 3 '---> here I an just stuck.
End If
End With
Next K
Thank you for your thoughts!!