ListView (Report View) Numeric Sorting
Hi,
I have a listview control in report view, and I have it so that when I click on a columnheader it sorts the list items by that column, the problem is that when I do that on a numeric column its sorts it like this
1 11 2 3 3100 4 ...
I was wondering how can I make it so it sorts the column correctly
1 2 3 4 11 3100
Let me know if you know a way
Thanks In Advance,
Zmei
Edited by - Zmei2004 on 8/29/2004 8:45:42 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Numeric Sorting In ListView
I searched both the Internet and this forum, and I found very little regarding this topic. I have a ListView control on my Form, and one column contains a number. When I sort, it looks like this:
0
1
2
30
400
5
6
7
Etc... So obviously, it is only sorting alphabetically, not numerically. How can I sort numerically? Will commas in the numbers hinder that?
Thanks in advance,
Jared
Ugly (numeric Listview Sorting)
In order to make a Column of numbered listview items sortable correctly, (1,2,3 ... 10, 11, 12 instead of 1, 10, 11, 12, 2, 3) jiggling variables seems to be absolutely necessary.
I did this:
Code:
If total(3) < 10 Then recordnumber = "0000" & total(3)
If total(3) >= 10 And total(3) < 100 Then recordnumber = "000" & total(3)
If total(3) >= 100 And total(3) < 1000 Then recordnumber = "00" & total(3)
If total(3) >= 1000 And total(3) < 10000 Then recordnumber = "0" & total(3)
If total(3) >= 10000 Then recordnumber = total(3)
It works fine, but it's just so butt-ugly. Does anyone have a good idea how to do this in shorter, more elegant code?
Sorting Numeric Data In Listview
Hi
I am trying to sort the data in the listview. I am displaying the data as follows in listview.
Id Name Desg Salary
1
2
99
9
111
Using the sortkey property of listview. But it always sorts the data as string. It works fine for the columns Name and Desg. But when i try to sort id n salary not getting correct results.
when i sort on id get the result as
1
111
2
9
99 where as the required o/p is it should sort as 1 2 9 99 111.
Need the help !
Regards,
Vidhi
Sorting A ListView On Numeric Data?
I have found two different codes to do this but I can't get it to work for me. I have tried to right align my strings. But when I do my varible goes to nothing.
Can someone help my right align my data so it will sort.
Sub ShowFolderList(folderspec)
Dim FolderScript, MainFolder, SubFolder, User, CurrentDir
Dim Size As String
Dim SizeTrim As Single
Set FolderScript = CreateObject("Scripting.FileSystemObject")
Set MainFolder = FolderScript.GetFolder(folderspec)
Set CurrentDir = MainFolder.SubFolders
For Each SubFolder In CurrentDir
DoEvents
On Error Resume Next
User = SubFolder.Name
Size = SubFolder.Size / 1052613.06
SizeTrim = Format(Size, "#,##0")
If Size > Text1.Text Then
ListView1.Font.Bold = True
Else
ListView1.Font.Bold = False
End If
ListView1.ListItems.Add 1, , User
ListView1.ListItems(1).ListSubItems.Add 1, , Right(CStr(SizeTrim) & String(4, " "), 4)
User = User & vbCrLf
Size = "N/A"
Next
End Sub
At the end ListView1.ListItems(1).ListSubItems.Add1, it adds nothing. But the varible is "SizeTrim" still there.
Help About ListView Report View
How can I add a new item to a particular column in report view? For example I have a columns named First and Second, I want to add an item to the Second column and not in First. Please tell me how. Please. Please. Please.
Sorting ListView In Report Mode...(more Than One Column)
Hi,
I was looking for a way to sort the content of the items that I have in a listview...
let's say something like:
Code:
Product Exp. Date Price
Bread 08/23/2002 0.25
Bread 08/28/2002 0.25
Milk 09/01/2002 1.00
Milk 09/05/2002 1.00
note that the sorting is name of the product & exp. date with the exp. date in asc as the name of the product is...
when I load the listview...I have no problem at all I just sort the recordset on the name of the product & the exp. date...and I have the ListView filled just the way I want... the problem comes when I move the products to another ListView there the products can be sorted only by one of this...name of the product or by exp. date but not by the two of them...
does anyone knows a workaround on this?
(the problem comes when i return the products from one listview to another and when moved in random order...
Thanks!
Listview - Report View With Icons?
Is it true that is you have the listview's view set to 3 (lvwReport) that it can't show icons?
I have a imagelist on a form with a picture in it. The picture has a key. I set the listview's icons and small icons to this imagelist. I tryed to add the picture to a listview menu item and used its key.
Didn't work. Any suggestions?
Right To Left ListView? (Report View)
I've tried implementing a right-aligned listview (comctl 6.0), but without any effect.
The listview is in report view mode.
Running WinXP. Shell language is Hebrew.
Code:
OldExStyle = GetWindowLong(lvwLearn.hWnd, GWL_EXSTYLE)
OldExStyle = SetWindowLong(lvwLearn.hWnd, GWL_EXSTYLE, OldExStyle _
Or WS_EX_LEFTSCROLLBAR Or WS_EX_RIGHT Or WS_EX_RTLREADING)
There is no apparent change to the listview, even though the call succeeds.
Does anyone have a solution?
ListView (Report View) Troubles...
I have a list view that can contain alot, a few, or no values at all at any given time.
The box will display existing information in row 1, then in row 2 it will display the information that will overwrite the existing information (if the user chooses). Then the 3rd will be existing, 4th new, 5th existing, 6th new, etc...
The grid goes in pairs, and the check boxes are turned on. By default nothing is checked. I want the user to be able to click whatever they choose, if they check the box on an odd row, then all the text in every cell of that row will go bold, and the entire row after that cell will lose its bold font (incase it was selected before). The rows look like this:
1 asdfas as as dasdfasf asdf
1 asdf asf asdf asdf asd fasf asd
2 asf asdf asdf asf asf asdf asdf
2 asf asd fasdf asd fasdf asdf asdf
3 asdf asdf asf asf asdf asdf asdf
3 asdf asdf adsf adsf as fasd
4 adsf asdf sdf asf sa dfas fasdf as
4 asdfasdfa sdf asdf as fafs
Of course with check boxes to the left of the numbers, if i click the 2 on the bottom, it will go bold and the 2 above it will be unchecked and go back to non-bold font. I know this is possible, im pretty close already.. Here's what i have:
Code:
Private Sub lvConflicts_ItemCheck(ByVal Item As MSComctlLib.ListItem)
Dim MyCount As Integer
If Item.Checked = True Then
Item.Bold = True
For MyCount = 1 To 8
Item.ListSubItems.Item(MyCount).Bold = True
Select Case Right(Item.Index, 1)
Case Is = 1, 3, 5, 7, 9
Item.ListSubItems.Item(MyCount).ForeColor = vbBlack
lvConflicts.ListItems(Item.Index + 1).ForeColor = &H808080
lvConflicts.ListItems(Item.Index + 1).Checked = False
Case Is = 0, 2, 4, 6, 8
Item.ListSubItems.Item(MyCount).ForeColor = vbBlack
lvConflicts.ListItems(Item.Index - 1).ForeColor = &H808080
lvConflicts.ListItems(Item.Index - 1).Checked = False
End Select
Next MyCount
Else
Item.Bold = False
For MyCount = 1 To 8
Item.ListSubItems.Item(MyCount).Bold = False
Select Case Right(Item.Index, 1)
Case Is = 1, 3, 5, 7, 9
Item.ListSubItems.Item(MyCount).ForeColor = vbBlack
lvConflicts.ListItems(Item.Index + 1).ForeColor = &H808080
Case Is = 0, 2, 4, 6, 8
Item.ListSubItems.Item(MyCount).ForeColor = vbBlack
lvConflicts.ListItems(Item.Index - 1).ForeColor = &H808080
End Select
Next MyCount
End If
End Sub
Im practically doing it already, i know it.. I think im just thinking too hard.. ive been working too long on this
Listview (report View) Scrollbars
I can't seem to figure this out: how do I add vertical and horizontal scroll bars to a Listview control with its "View" property set to "lvwReport"? I have tried many thing ... but none seem to work.
Icons In Listview In Report View
Hi, I am having trouble trying to display icons in a listview. I am displaying the listview in report mode and I have all the imagelists properly bound. If im not mistaken, the icons used in the report view use the 'small' imagelist, correct? Anyway I am populating the imagelist by creating a ListItem variable and setting it to Listview1.Add each time through the loop. Could this be the problem?
Moving Columns On A Listview (Report View)
I want to programmatically set the Position of the columns in a list view.
This is an "after thought" so I am trying to do it on already loaded listviews.
I see from a little experimentation that I can easily move the column headers by simply changing the .position property.
But that does not bring over the data for that column. (Just the header)
Do I have to manually move the data or there an easier way?
(By "manually move the data" I mean set up a temp array, copy the column's data, update new column after moving other column into original col number)
Regards,
ListView Report Mode View - RESOLVED
When I change to report mode view nothing is showing up in my listview. When I change it to List view my data shows up. Any ideas?
VB Code:
Private Sub LoadTableSpecs() Dim oSQLServer As New SQLDMO.SQLServer Dim oSQLDatabase As New SQLDMO.Database Dim oSQLTable As New SQLDMO.Table Dim oSQLColumn As New SQLDMO.Column Dim i As Integer Dim liObject As ListItem ListView1.ListItems.Clear oSQLServer.LoginSecure = True oSQLServer.Connect Form1.cboServer1.Text Set oSQLDatabase = oSQLServer.Databases(Form1.cboDatabase1.Text) Set oSQLTable = oSQLDatabase.Tables(Form1.cboTable1.Text) For Each oSQLColumn In oSQLTable.Columns Set liObject = ListView1.ListItems.Add(, , oSQLColumn.Name) liObject.SubItems.Add , , oSQLColumn.Datatype liObject.SubItems.Add , , oSQLColumn.Length Set liObject = Nothin Next oSQLServer.DisConnectSet oSQLServer = NothingEnd Sub
ListView (Report View) - Adding Items
AH! This is embarassing yet very frustrating. The last time I worked with the list view control was a loooong time ago. Unfortunately, I lost that project when my computer crashed (no big deal really, the program was never even completed). At any rate, how the heck do I add subitems and items to a report view listview?!
eg
Column 1 Column 2
Add Item Add Item
Add Item Add Item
Last Column Width In Listview (report View)
Hi,
Does anyone know an easy way I can make the width of the LAST column header in a 'report view' listview automatically be equal to the space available.
ie,
if the other columns take up half the width of the listview, the last column takes up the other half.
Similary, if the width of one of the other columns changes, the width of the last column is automatically changed appropiately (so there is never a horizontal scroll bar).
Thanks in advance for any help you can give me.
Tom.
Last Column Width In Listview (report View)
Hi,
Does anyone know an easy way I can make the width of the LAST column header in a 'report view' listview automatically be equal to the space available.
ie,
if the other columns take up half the width of the listview, the last column takes up the other half.
Similary, if the width of one of the other columns changes, the width of the last column is automatically changed appropiately (so there is never a horizontal scroll bar).
Thanks in advance for any help you can give me.
Tom.
Editing Selected Item In ListView In Report View
How can I edit the second column of data in a listview control? I am making a properties box much like the one you use in VB. The first column information for each item can not be editable but the second column is going to be the value for each item and I need for it to be able to click and type in it just like in VB (or at least similar to that).
Any help and sample code is appreciated. Thanks.
*solved*I Wanna Learn ListView In Report View
hi this is a new thread after advice on moving from Picture1 to now i believe ListView in Report view is the way to go.
Metallisoft can you help me get his going. I have attached form1 to download and change as i can't get it to work. your reference click here hasnt helped me as it gave me 3 values i only need 2
Database eg
Quote:UNIVERSAL OEM MFG
16190 2-1428-HI WAI
16190 SJ-0001R AIM
16190 91-25-1030 WILSON
16190 S9024 LUCAS REMAN
16190 9821006350 ISUZU
16190 9821006060 ISUZU
16190 S114-136 HITACHI
16190 S114-100 HITACHI
16190 SR198X BOSCH REMAN
16190 94022494 GENERAL MOTORS
16190 RXS056 OEX
16190 94021044 GENERAL MOTORS
16190 S114-118 HITACHI I Don't need to display the UNIVERSAL Numbers Just OEM anf MFG only
Code:Private Sub Command3_Click()
Set rs = New ADODB.Recordset 'this will be the rs
Dim strSQL As String 'this the source
'make the selection string: filter the records right away
strSQL = "SELECT C.* FROM OEMS AS C where UNIVERSAL in(select UNIVERSAL from OEMS where oem='" & UCase$(Text1) & "')"
' To hold a reference to the current Listitem (row).
Dim oLVItem As MSComctlLib.ListItem
' The (Listview.Width - 350) / 3 simply adjusts the column
' widths to 1/3 the width of the Listview (subtracting the
' width of the scrollbar)
' ListView.ColumnHeaders.Add , , "Supplier", (ListView.Width - 350) / 3 '<- Don't need to work?
ListView.ColumnHeaders.Add , , "OEM", (ListView.Width - 350) / 3
ListView.ColumnHeaders.Add , , "Manufacturer", (ListView.Width - 350) / 3
Picture1.Cls
Picture1.FontSize = 8
Picture1.Font.Bold = True
Picture1.Print ">> Supplier Information"
Picture1.Font.Bold = False
Picture1.Print "OEM:"; Tab(20); "Manufacturer:"
rs.Open strSQL, oConnection, adOpenStatic, adLockOptimistic, adCmdText
'loop through the recordset
Do Until rs.EOF
M19 = rs("OEM") 'Are m19 and m20 properties or local variables? didn't want to take them out, but if they are global settings and there are more records, they will only 'remember' the values in the last record.(No they are strings in a database)
M20 = rs("MFG")
Picture1.Print M19; Tab(20); M20
rs.MoveNext
Loop
rs.Close 'Close the recordset never leave it open!
Set rs = Nothing 'clear the rs variable
End Sub
OK NOW how do i replace the Picture1 to ListView in Report view after reading MSDN click here CAN anyone save me? the ColumnHeaders don't display too?
Edited by - Hopeless on 6/4/2004 12:16:16 AM
ListView Control. How Do You Extractupdate Values In Report View
I have populated my ListView control with my values using DAO. I have 10 columns set up in report view. In my code fragment below, I am looking through my listview control searching for rows that the user has selected. Now I need to be able to extract some of the sub values and update others. How do I do this? Here is my code so far.
Private Sub SelectedCountCommand_Click()
Dim i As Integer
For i = 1 To ListView1.ListItems.Count
If ListView1.ListItems(i).Selected = True Then
'extract values from col 3 and 4 and subtract them
'update column 5 based on the results of col 3 minus col 4
End If
Next
End Sub
Help: How To View Selected Items From Listview With Crystal Report Viewer
Hi
I have a Listview with check boxes from it want to view selected items with crystal report viewer.
Private Sub cmdView_Click()
Dim lCustomerId as Long
Dim tmpItm As ListItem
For Each tmpItm In lstItems.ListItems
If tmpItm.Checked = True Then
lCustomerId = Val(Replace(tmpItm.Key, "C", ""))
End If
Next
End Sub
Plz. help
regards
ListBox, Numeric Sorting
Any ideas? I need to sort items in the listbox numerically (from the highest to the lowest #). This is how my listbox looks like.
Tom 2
And 15
Jerry 6
I used a two dim. array (the second column stored the word, 1st column stores the number) to display the contents in the listbox. This is my code:
For intArray = 0 To UBound (strResults, 2)
lstDisplay.AddItem strResults(1, intArray) &" " & strResults(0, intArray)
Next
Thanks for any suggestions or input.
Sorting Numeric And String Value
How can I sort numeric and string value?
for example:
1,10,11,12,2,2-3,4,5,S1,S2,S2P
to
1,2,2-3,4,5,10,11,12,S1,S2,S2P
Numeric Sorting In Listivew,vb6
I need to sort a list in numeric Order if any body have code for this Please send me that....
Thanks in Advance
Sunil Sharma
Acess Database Numeric Text Sorting
Hi,
I have a problem where I need to sort a Microsoft Access database by the ID field in ascending order. The problem is the primary ID field is a text field that is populated by an integer. So if use the generic sorting in Access it will only sort by the first integer, ie:
12
10
11
23
24
21
31
33
32
As you can see only the first integer is taken into consideration and not the whole number because the primary id field is not an integer field, but a text field. I cannot use the simple solution of changing the primary ID field to an integer field, because for default reasons, that field HAS to be text.
Is there a way to sort this datbase properly, without changing the primary field to an integer field? I am using Visual Basic to manipulate this database, so any help would greatly be appreciated in VB language!!!!
Thanks in advance!!!
Can I Sort A List View By A Numeric Field
I have a list view which I populate at run time, including creating the column headers. I don't know exactly what the columns are going to be at design time.
I want the column to be sortable when a user clicks on the column header but a list view uses a text sort by default, so in a numeric column 99 will appear to be higher then 100. Normally I'd get around this by hiding a column with the numeric values left padded with zeros and then sort by that instead but, due to the dynamic nature of the columns, that's going to be a bit of a nightmare to manage.
Does anyone know of a way I can 'tell' the column it's a numeric so that it sorts in a numeric fashion, or maybe override the sort algorithm myself?
Cheers
Dec
Sorting A List View
Hi!
I have a List View with items that correspond to folders and items that correspond to files.
When i sort the listview (.Sorted=True) the folder items and the file items get mixed up. Is there any way i can keep this two kinds of item separated withount having to sort them myself.
For instance is the a way to order the listview by two or more columns?
Thanks!
List View Date Sorting
Greetings and Salutations!
How can I sort a list view column that is a date so that it is sorted properly.
The only way I can do it is to input the date as yyyy/mm/dd.
I want to have the date as mm/dd/yyyy but then the list is sorted by month no matter what the year is.
I have seen it done in other applications....
Any help would be appreciated!!
Numeric Sort On ListView Column
Code:
Private Sub lsvList_ColumnClick(ByVal ColumnHeader As MSComctlLib.ColumnHeader)
Static intColumn As Integer
Static intSwitch As Integer
If intColumn = ColumnHeader.Index Then
intSwitch = intSwitch + 1
If intSwitch > 1 Then intSwitch = 0
Else
intSwitch = 0
intColumn = ColumnHeader.Index
End If
If intSwitch = 0 Then
lsvList.SortOrder = lvwDescending
Else
lsvList.SortOrder = lvwAscending
End If
lsvList.SortKey = ColumnHeader.Index - 1
End Sub
I'm using this to sort listview columns, but of course it's doing a text comparison sort. Is there an easy way to do a numeric sort? Or am I going to have to sort it myself? Thanks.
Sort Numeric Values In ListView
Hello devs,
i have listview that store records from db at runtime.
it contains a numeric column in subitems of listitems.
i have tried following snip in ColumnClick Event of Listviewto sort listview ,
It sort string columns very acuurately.
Code:
Dim currSortKey As Integer
LvCat.SortKey = ColumnHeader.Index - 1
LvCat.SortOrder = Abs(Not LvCat.SortOrder = 1)
LvCat.Sorted = True
but it doesn't sort list view properly for Numeric Values. Instead it treat as
characters . so please help me
It May seem Impossible, But Possibly We don't know the way how to reach there ????
Sorting On DATE Columns In MS List View
Does anybody know how to get this to work?
The listview seems only capable of accepting strings as it's items so dates have to be converted to text and therefore are sorted as text.
How can I get around this?
List View Sorting And Internal Indexes
This post may sound similar to another I posted recently but it is different. I have several list views which I am using the default sort(ascii) and a special group of routines to sort numeric and date fields. The problem with this is that my internal indexes are not being sorted while my list views ui is. Is there a way to resort the index? If it helps, I am using SendMessage and LVM_FINDITEM along with other messages to do the sorting for numbers and dates. Thanks in advance.
Following is my case statement:
Select Case ColumnHeader.Index
Case 3, 5:
'Use default sorting to sort the items in the list
TheList.SortKey = ColumnHeader.Index - 1
TheList.SortOrder = (-1 * TheList.SortOrder) + 1
TheList.Sorted = True
Case 4:
'Use sort routine to sort by date
TheList.Sorted = False
SendMessageLong TheList.hWnd, _
LVM_SORTITEMS, _
TheList.hWnd, _
AddressOf CompareDates
Case 1, 2:
'Use sort routine to sort by value
TheList.Sorted = False
SendMessageLong TheList.hWnd, _
LVM_SORTITEMS, _
TheList.hWnd, _
AddressOf CompareValues
End Select
Data Report - Numeric Field
How do you control numeric printing inside the data report?
e.g. I do not wish to print the zero. Can't find any suppress zero function inside the dataformat.
regards
Crystal Report Numeric Format
Hello,
We are using VB6 and crystal report 8.0. We have one numeric field in crystal Report. I want that comma's in that field to come according to Indian Comman Style.
Eg for 10 Million crystal report will show 10,000,000 but according to Indian Comma stryle I need show 1,00,00,000 How to make this localized data output format? (i.e first comma after 000's and then other commas after 00's eg 11,22,33,44,555 )
Thanks and Regards,
Amit
Numeric Convervsion To String For Report Criteria
For selecting criteria for my reports, I have a user select a value from a combo box and then click on the report name. The report then opens the report with the selected criteria. The problem I'm having is with date and numeric fields in the DoCmd.OpenReport. I keep getting a type mismatch. Here is the code I'm using. Take a look and let me know of any problems.
If chkCdfsLine = True Then
strCDFS = CStr(cboCdfsLine.Value)
If strBuild = " " Then
strBuild = strBuild & "[CDFSLINE] = '" & strCDFS & "'"
Else
strBuild = strBuild & "AND [CDFSLINE] = '" & strCDFS & "'"
End If
End If
strCriteria = strBuild
If strCriteria <> " " Then
DoCmd.OpenReport "Part Summary", acPreview, , strCriteria
Else
DoCmd.OpenReport "Part Summary", acPreview
End If
Thanks
Crystal Report Numeric Field Format
Hi,
i want to format my numeric field. can we format the field with coding in crystal report such format in the fields's property. i want to remove , from my numeric field in a formula and format it as in vb format(field, "00000"). how it in crystal reports?
thanks
DATA REPORT && Oracle Numeric Type
Hello all
I have created an parameterised group report from oracle using a data environment and data report designer. It all works ok apart from I try and add a function in it reports back "Data Type Mismatch in Function1". This Function1, is in the group footer section and all it does is sum a numeric field.
This seems to be the main problem, that is that Oracle uses a generic numeric type and probably VB is expecting something more specific (i.e. Long Integer )
Any suggestions are welcome.
Thanks
:(
Using Format With Numeric Values In A Printer Report
Printing a numeric value using Format commad, How can i make that the program prints the value Right to Left. Example
---colum---
29.99____ = This is the way that prints
____29.99 = this is the way i want to be printed
___= equal to spaces
Any help
adcomp
Sorting In Listview
In this code...
Code:
Private Sub lvwNormal_ColumnClick(ByVal ColumnHeader As MSComctlLib.ColumnHeader)
With lvwNormal
If .SortKey <> ColumnHeader.Index - 1 Then
.SortKey = ColumnHeader.Index - 1
.SortOrder = lvwAscending
Else
If .SortOrder = lvwAscending Then
.SortOrder = lvwDescending
Else
.SortOrder = lvwAscending
End If
End If
.Sorted = True
End With
End Sub
...I'm trying to sort the contents in ascending and descending manner. The list contains some numbers and some dates. But the thing is, when sorting by number and dates, it's sorting taking the first digit of any number and the sub-sequent digits for sub-sorting. Like for example, for numbers, first row is 1, then instead of 2, 3, 4, 5 and so on, it goes like 1, 10, 100, 1000... As for the date, our date format is dd/mm/yyyy. So if the first date is 01/01/2005, the next date should be 02/01/2005 and so on. But it is sorting like 01/01/2005, 01/02/2005, 01/03/2005 and so on 'til it reaches 01/12/2005 and then 02/01/2005 and so on. This is the code that would fill the Listview upon form load...
Code:
Private Sub FillNormal()
Dim SQL As String
On Error Resume Next
lvwNormal.ListItems.Clear
SQL = "SELECT ActiveOrders.JPO, customers.KU_NAME, ActiveOrders.CustJPO, ActiveOrders.OrdDate, " & _
"ActiveOrders.DlvDate, ActiveOrders.NewDlvDate, ActiveOrders.Remarks " & _
"FROM ActiveOrders INNER JOIN customers ON ActiveOrders.CustNo = customers.KU_NR " & _
"WHERE JPO < '5000000' ORDER BY JPO ASC"
Set NormalRS = New ADODB.Recordset
NormalRS.Open SQL, DB
Do While Not NormalRS.EOF
Set ItemX = lvwNormal.ListItems.Add(, , NormalRS!JPO)
ItemX.SubItems(1) = NormalRS!KU_NAME
ItemX.SubItems(2) = NormalRS!CustJPO
ItemX.SubItems(3) = Format(NormalRS!OrdDate, "dd/mm/yyyy")
ItemX.SubItems(4) = Format(NormalRS!DlvDate, "dd/mm/yyyy")
ItemX.SubItems(5) = Format(NormalRS!NewDlvDate, "dd/mm/yyyy")
ItemX.SubItems(6) = NormalRS!Remarks
NormalRS.MoveNext
Loop
SQL = ""
NormalRS.Close
Set NormalRS = Nothing
End Sub
...I've already tried CDate,CSng, etc. and even CAST and CONVERT on the SQL command and still I get the same results. But the funny thing is, the first column that is filled by the NormalRS!JPO (which is a 5 digit number by the way) is sorting out fine. Can somebody please tell me what's going on...
Sorting ListView
i am having trouble sorting a list view control!!
the first column of the list view contains date values however, on load these are not sorted in ascending order (as specifed in the properties). Instead, the dates are sorted in order of the "Day" value.
How do you sort the list view in ascending date order in the date format ddmmyyyy on form load?
PLEASE HELP!!
Listview Sorting
Hi,
I have a listview populated from a .txt file.
Subitems(1) and (2) are in fact date() typed intems.
If I do the sorting with:
lvwLog.SortKey = ColumnHeader.Index - 1
lvwLog.Sorted = True
then the stringrelated columns are sorted properly, if I click the Columnheaders with the Date() items, the sorting is not be made correct.
Question, how to sort those Date() items
Regards
Charles
Listview Not Sorting...
i have a list view for my hiscores and i have it sorting Descending.
the problem is that if i have scores 100,200,300,900,1000 it sorts them in the order 900,300,200,1000,100 how would i make it sort them in the order from biggest to smallest??
Sorting ListView
Howdy, I figured Id post a stupid little trick I figured out for sorting listiview that changed my code from
this
Code:
Private Sub lstSplit_ColumnClick(ByVal ColumnHeader As MSComctlLib.ColumnHeader)
lstSplit.SortKey = ColumnHeader.Index - 1
lstSplit.SortOrder = 1 then
lstSplit.SortOrder = 0
else
lstSplit.SortOder = 1
endif
lstSplit.Sorted = True
End Sub
to this
Code:
Private Sub lstSplit_ColumnClick(ByVal ColumnHeader As MSComctlLib.ColumnHeader)
lstSplit.SortKey = ColumnHeader.Index - 1
lstSplit.SortOrder = Abs(lstSplit.SortOrder - 1)
lstSplit.Sorted = True
End Sub
mkay buybye then.
ListView Not Really Sorting
Hey everyone!
I needed to sort a column of a listview by value, so I found in other topic how to achieve this using the API. It worked well, it sorts the numbers correctly. The problem is that, after sorting using the API method, if I access any element in the list view (ListView1.Listitems(4).Text for example), the text returned is the old text, before sorting. It's seems that sorting via API do not update the indexes or something like that.
How can I correct this problem? (I need to save the sorted listview into a text file).
Thanks in advance,
Fergo
Sorting A ListView
Hey all,
Ive search this forum and the net and I cant come up with an answer, hopefully you can point me in the right direction.
I need to be able to drag items around within a Listview to reorder them, yet I cant figure it out.
For example if the items are in the order
1
2
3
I need the user to be able to select Item 3 drag it in between items 1 and 2 and have the new order be
1
3
2
I just cant figure it out. =/ I know its with the mouse down drag drop, one thing im really lost on is how to indicate to the user that the mouse has a listitem on it so the user knows to place it somewhere else.
Thanks for any help you can provide,
Saz
|