[求助]怎样在MSFlexGrid和MSHFlexGrid中,将货币值格式化为“¥0.00”呢?
对于在Access中已经格式化的货币值,比如¥28.00,在MSFlexGrid和MSHFlexGrid中,输出的都是28,怎样在MSFlexGrid和MSHFlexGrid中,将货币值格式化为“¥0.00”呢?
如果要顺便给MSHFlexGrid加上行号,只需在上面的代码中加一行代码:
MSHFlexGrid1.TextMatrix(i, 0) = i
这样就成了:
Dim i As Integer
Dim n As Integer
For i = 1 To Adodc1.Recordset.RecordCount
For n = 2 To 5
MSHFlexGrid1.TextMatrix(i, n) = Format(MSHFlexGrid1.TextMatrix(i, n), "¥0.00")
MSHFlexGrid1.TextMatrix(i, 0) = i
Next n
Next i