0

i have 1 msflexgrid. in column two, i want to set the data for integer value and 1 decimal places.how to set this column?
anybody can help me...
i'm using visual basic6

2
Contributors
3
Replies
5
Views
8 Years
Discussion Span
Last Post by AndreRet
0

I take it that the data in coloumn 2 is an integer (amount)? Do you want to calculate the sum of all amounts in coloumn 2 and show that total amount in a text box?

0

I take it that the data in coloumn 2 is an integer (amount)? Do you want to calculate the sum of all amounts in coloumn 2 and show that total amount in a text box?

no..i insert only one integer (double)..
for example:-
2.1 in column 2
if user insert 2.13, it's only display 2.1...
how to setting this column same like that??

0

Try the following:

Set CON = New ADODB.Connection
CON.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\FlexGridSample.mdb;"
Set RS = New ADODB.Recordset
RS.Open "SELECT * FROM TableName", CON, adOpenStatic, adLockBatchOptimistic
set MSFlexgrid.DataSource = RS
Dim i as Long, j as Long
For i = 1 To RS.RecordCount  'this loop is for rows
   For j = 1 To RS.Fields.Count 'this loop is for Columns
      MSFlexgrid.TextMatrix(i, 1) = Format(RS!  SecondFieldName,"###.#") 'Your format of only 1 decimal. See (i,1) where 1 is the second coloumn
    Next

    RS.MoveNext
  Next

Attached a more detailed grid and comment help for you.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.