Results 1 to 4 of 4

Thread: Simple MSH flex grid question

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2000
    Location
    Brunei
    Posts
    100

    Red face

    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

  2. #2
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Talking

    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.

  3. #3
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Talking

    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.

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Jul 2000
    Location
    Brunei
    Posts
    100
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width