Solved

True DBGrid number format

Posted on 1997-07-30
4
2,104 Views
Last Modified: 2012-08-13
Hello there

  I recently downloaded the True DBGrid Standard from the Apex Site.
  The problem I have is that I can't make the DBGrid force the values in certain cells to be displayed with 2 decimal places. If the value is entered with decimal places, it is displayed with them, otherwise, it is not. I already tryed to specify, in the DBGrid properties, the format for the values, but it still doesn't work. If I browse my table, with MS
Access, the values are displayed correctly, but not in the True DBGrid.

  Am I doing something wrong?
  How am I supposed to do it?
0
Comment
Question by:rbarradas
  • 2
4 Comments
 
LVL 3

Expert Comment

by:dansari
Comment Utility
rbarradas:

Have you tried to set the format of the column object to "0.00"?  This should force 2 decimal places to be displayed.  It does with my True DBGrid (Pro).
0
 
LVL 1

Author Comment

by:rbarradas
Comment Utility
It still doesn't work.
Maybe I'm doing something wrong. I've already tryed to format the cell in  design and in run time mode. Any other ideas?
Thanks...
0
 

Accepted Solution

by:
gikass earned 100 total points
Comment Utility
I assume you are talking about formatting of data you read off a database.

As far as I know, you do not format a CELL, you must format a column.
Use the NumberFormat property of the COLUMN object:

DataGrid1.Columns(j).NumberFormat = "###0.00"

0
 
LVL 1

Author Comment

by:rbarradas
Comment Utility
It still doesn't work. I don't know if I am doing it the right way. To populate the Grid I'm using a Data Control. Where Am I supposed to put that instruction?
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now