PDA

Click to See Complete Forum and Search --> : Simple MSH flex grid question


rathi
Aug 17th, 2000, 07:12 AM
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

James Stanich
Aug 21st, 2000, 09:40 AM
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.

James Stanich
Aug 21st, 2000, 10:15 AM
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.

rathi
Aug 23rd, 2000, 04:20 AM
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.

Hi James,

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