3 Replies - 413 Views - Last Post: 10 July 2017 - 10:48 AM Rate Topic: -----

#1 Levin_G  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 10-July 17

MSHFLEXGRID How to Sort Numbers 1 to 10

Posted 10 July 2017 - 10:36 AM

I am trying to sort numbers from MSHFlexgrid from 1 to 10 but the result is as shown in the attached screenshot.

as for my codes:


Dim conn As New ADODB.Connection
Dim rs As New ADODB.Recordset 
               
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\db1.MDB;Persist Security Info=False"

rs.Open "select Estimation_No, Item_No, Type, Panels, Width, Height, Quantity, Workmanship, Accessories, Additional_Workmanship, Fixed_Accessories, Work_and_Acc, Fixed_Price from Table1 where Estimation_No='" & txtEstNo.Text & "' order by Item_No asc", conn, 3, 3
Set grid2.Recordset = rs
:code:

This post has been edited by modi123_1: 10 July 2017 - 10:38 AM
Reason for edit:: In the future please use the [code] button in the editor.


Is This A Good Question/Topic? 0
  • +

Replies To: MSHFLEXGRID How to Sort Numbers 1 to 10

#2 Levin_G  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 10-July 17

Re: MSHFLEXGRID How to Sort Numbers 1 to 10

Posted 10 July 2017 - 10:42 AM

I could not upload screenshot. anyway the result I'm getting is as follow:

-1
-10
-2
-3
-4
-5
-6
-7
-8
-9

These are item No. so I need them to show in proper order 1 to 10.

Thanks for the help guys.
Was This Post Helpful? 0
  • +
  • -

#3 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 13489
  • View blog
  • Posts: 53,887
  • Joined: 12-June 08

Re: MSHFLEXGRID How to Sort Numbers 1 to 10

Posted 10 July 2017 - 10:43 AM

What is the datatype of 'Item_No' column?
Was This Post Helpful? 1
  • +
  • -

#4 Levin_G  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 10-July 17

Re: MSHFLEXGRID How to Sort Numbers 1 to 10

Posted 10 July 2017 - 10:48 AM

View Postmodi123_1, on 10 July 2017 - 10:43 AM, said:

What is the datatype of 'Item_No' column?




OMG... Thank you so much... I fixed it. it was Long Text. I changed it to Number and it worked. Thanks :bananaman:
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1