Hi everyone,
I want to format a column in to currency in msh flexgrid control. After spending a whole day, I still can not find out how.
Pls, give me some idea.
Thank you.
sincerely,
Rathi
Printable View
Hi everyone,
I want to format a column in to currency in msh flexgrid control. After spending a whole day, I still can not find out how.
Pls, give me some idea.
Thank you.
sincerely,
Rathi
Is it possible to store the values as currency prior to loading them in grid? If so,store then display. If not, try masked-edit box set to currency.
Just a thought.
Me again. I tries it my program and it works. Let me know if this helps:
MyData _
= rst!ROWNO _
& vbTab & rst!IDNumber _
& vbTab & rst!Class _
& vbTab & Format(rst!Wage, "currency") _
& vbTab & Format(rst!PayST, "currency") _
& vbTab & Format(rst!PayOT, "currency") _
& vbTab & Format(rst!PayDT, "currency") _
& vbTab & Format(rst!DeductST, "currency") _
& vbTab & Format(rst!DeductOT, "currency") _
& vbTab & Format(rst!DeductDT, "currency") _
MSFlexGrid1.AddItem MyData
Refresh
Of course, I am pulling info from a database so this may have to be customized for your program. Good Luck.
Hi James,Quote:
Originally posted by James Stanich
Me again. I tries it my program and it works. Let me know if this helps:
MyData _
= rst!ROWNO _
& vbTab & rst!IDNumber _
& vbTab & rst!Class _
& vbTab & Format(rst!Wage, "currency") _
& vbTab & Format(rst!PayST, "currency") _
& vbTab & Format(rst!PayOT, "currency") _
& vbTab & Format(rst!PayDT, "currency") _
& vbTab & Format(rst!DeductST, "currency") _
& vbTab & Format(rst!DeductOT, "currency") _
& vbTab & Format(rst!DeductDT, "currency") _
MSFlexGrid1.AddItem MyData
Refresh
Of course, I am pulling info from a database so this may have to be customized for your program. Good Luck.
Thank you very much for your time and support.
I use this code, to format all the cells in 9th column to
currency.
Private Sub Format()
Dim rows as integer
dim i as integer
rows = val(MSHFlexgrid1.Rows -1)
For i = 1 to rows
MSHFlexgrid1.Col = 9
MSHFlexgrid1.Row = i
MSHFlexgrid1.Text = Formatcurrency(MSHFlexgrid1.Text)
Next i
End sub
==========
Any comments?
sincerely,
Rathi