Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

MSHFlexgrid problem with decimal values

Posted on 2002-04-12
6
Medium Priority
?
318 Views
Last Modified: 2012-06-27
I've a MSHFlexgrid connected to a ADODB.recordset that retrieve decimal numbers.
But the MSHFlexgrid doesn't show them with the comma, only with the dot.

How can a solve this problem.
I've tried the datagrid, and MFlexgrid and they show the values just fine.

Thanks
0
Comment
Question by:asimoes
  • 3
  • 2
6 Comments
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 800 total points
ID: 6936641
you can loop through the lines and columns of your grid and use the Format function to display what you want:

With mshfgMB
   For intLine = gkbytStartLine To .Rows - 1
      For intCol = gkbytStartCol To .Cols - 1
        .TextMatrix(intLine, intCol) = Format(sngTotal, "###,##0.0000")
      Next
   Next
End With
0
 
LVL 1

Expert Comment

by:harsh008_k
ID: 6936642
hi asimoes,
If u take my advice,dont connect mshfgrid to recordset
instead write ur code,it is not big dealwriteing few lines,the flexibility it gives is high and u can play around the u want.
if u want to merge repeated rows then use merge property.
what ever data u put will be in text,u can format  it the way u want.
if u want further help reply back.
This advice should help u
0
 
LVL 1

Expert Comment

by:harsh008_k
ID: 6936655
'This code I have used inmy project,It can help u in coding
'U could even write lean code(reduced lines)  'ur 'requirements are simple

Private Sub showsales(rsshowsales As ADODB.Recordset)
   Dim i As Integer
     
   hfgridSales.Rows = rsshowsales.RecordCount + 1
   With hfgridSales
       For i = 1 To .Rows - 1
       .TextMatrix(i, 0) = rsshowsales.Fields(2)
       .TextMatrix(i, 1) = Format(rsshowsales.Fields(0), "dd/mmm/yyyy")
       .TextMatrix(i, 2) = rsshowsales.Fields(1)
       .TextMatrix(i, 3) = rsshowsales.Fields(9)
       .TextMatrix(i, 4) = rsshowsales.Fields(10)
       .TextMatrix(i, 5) = rsshowsales.Fields(11)
       .TextMatrix(i, 6) = rsshowsales.Fields(3)
       .TextMatrix(i, 7) = rsshowsales.Fields(4)
       .TextMatrix(i, 8) = rsshowsales.Fields(5)
       .TextMatrix(i, 9) = rsshowsales.Fields(6)
       .TextMatrix(i, 10) = rsshowsales.Fields(7)
       If rsshowsales.Fields(8) = "Add K.S.T" Or rsshowsales.Fields(8) = "Add C.S.T" Then
          .TextMatrix(i, 11) = Mid(rsshowsales.Fields(8), 5, Len(rsshowsales.Fields(8)) - 4)
       Else
         .TextMatrix(i, 11) = rsshowsales.Fields(8)
       End If
        rsshowsales.MoveNext
     Next
    .MergeCells = flexMergeFree
    .MergeCol(0) = True
    .MergeCol(1) = True
    .MergeCol(2) = True
    .MergeCol(3) = True
    .MergeCol(4) = True
    .MergeCol(5) = True
    .MergeCol(6) = True
    .MergeCol(7) = True
    .MergeCol(8) = True
    .MergeCol(9) = True
    .MergeCol(11) = True
  End With
End Sub
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 70

Expert Comment

by:Éric Moreau
ID: 6985040
any progress?
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 7060638
This question appears to be abandoned. A question regarding it will be left in the Community Support
area; if you have any comment about the question, please leave it here.

Unless there is objection or further activity, one of the moderators will be asked to accept the comment
of <emoreau>.

The link to the Community Support area is:
http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt

DO NOT ACCEPT THIS COMMENT AS AN ANSWER.
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 7065779
Thanks, emoreau  for your help here.

I have finalized this question, and will monitor it for comments.

Moondancer - EE Moderator
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

782 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question