jana
asked on
Help on sorting vbAccelaratoe Grid in Outlook 2007 VBA
We place the sorting accordingly. However, when the results are displayed, it is not really sorted.
This is what we have
UserForm1.gridItemsFound.S ortObject. Clear
UserForm1.gridItemsFound.C olumnSortO rder(i_DAT E) = CCLOrderAscending
UserForm1.gridItemsFound.S ortObject. SortColumn (i_DATE) = 1
UserForm1.gridItemsFound.S ort
Please advice
This is what we have
UserForm1.gridItemsFound.S
UserForm1.gridItemsFound.C
UserForm1.gridItemsFound.S
UserForm1.gridItemsFound.S
Please advice
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
You are correct, "UserForm1.gridItemsFound. Redraw = False" was missing.
But still doesn't sort.
We want to sort by a Date instead of Project/Subject:
UserForm1.gridItemsFound.S ortObject. Clear
UserForm1.gridItemsFound.C olumnSortO rder(i_DAT E) = CCLOrderAscending
UserForm1.gridItemsFound.S ortObject. SortColumn (i_DATE) = 1
UserForm1.gridItemsFound.S ort
The date is converted to string, like "2012-0409 7:59:00 PM" (haven't had the chance to actually convert the column to Date)
Am I missing something?
But still doesn't sort.
We want to sort by a Date instead of Project/Subject:
UserForm1.gridItemsFound.S
UserForm1.gridItemsFound.C
UserForm1.gridItemsFound.S
UserForm1.gridItemsFound.S
The date is converted to string, like "2012-0409 7:59:00 PM" (haven't had the chance to actually convert the column to Date)
Am I missing something?
OK stand by.....
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Sorry about the confusion. The "Click" on the header sorts the Grid ok. The problem we have is when the Grid is displayed initially. When the user first enter the grid and searches for specific, the result is not sorted the columne we need; the Date column.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I replace as you have it, but still no sort.
I think your last entries ID: 37826342 and forward, pertains to a question we placed regarding dates.
I think your last entries ID: 37826342 and forward, pertains to a question we placed regarding dates.
I have fixed the sorting date problem.
But first, what date field are you using "SentOn" or "ReceivedTime"?
Cheers
Chris
But first, what date field are you using "SentOn" or "ReceivedTime"?
Cheers
Chris
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
We have found this to be even faster. But I keep getting an error with the form. Can you send me the UserFrom1?
ASKER
The error I keep getting is when exiting the Form
-------------------------- -
vbAccelerator SGrid II Control
-------------------------- -
Run-time error '0'
-------------------------- -
OK
-------------------------- -
--------------------------
vbAccelerator SGrid II Control
--------------------------
Run-time error '0'
--------------------------
OK
--------------------------
ASKER
Somehow solved it by exiting outlook, deleting the userform and re-importing it; its working.
However we are trying to understand the coding so we can tweak with it. The collowing are the lines we are wondering what are they for. Please just give a super brief of each line:
1. user32.dll
2. UserForm1.gridItemsFound.G ridLines = True
3. .AddColumn vKey:="ID", sheader:="ID", lcolumnwidth:=20, bVisible:=False
4. .ColumnOrder(1) = GetSetting(Application.Nam e, "Setup", "ColOrder1", 1)
5. .ColumnWidth(1) = GetSetting(Application.Nam e, "Setup", "ColWidth1", 400)
6. .ColumnOrder(2) = GetSetting(Application.Nam e, "Setup", "ColOrder2", 2)
7. .ColumnWidth(2) = GetSetting(Application.Nam e, "Setup", "ColWidth2", 50)
8. .ColumnOrder(nCol) = GetSetting(Application.Nam e, "Setup", "ColOrder" + CStr(nCol), nCol)
9. lColIndex(i_SUBJECT) = .ColumnIndex("Subject")
10. Session.Application.Active Explorer.A ctivate
11. UserForm1.Caption = GetSetting(Application.Nam e, "Setup", "FormCaption", "Search for SUBJECTS")
12. txtSearch.Text = GetSetting(Application.Nam e, "Setup", "txtSearch", "")
13. nSelectedRow = GetSetting(Application.Nam e, "Setup", "SelectedRow", 1)
14. nSelectedCol = GetSetting(Application.Nam e, "Setup", "SelectedCol", 1)
15. UserForm1.MousePointer = fmMousePointerHourGlass
16. gridItemsFound.Sort
17. UserForm1.MousePointer = fmMousePointerDefault
However we are trying to understand the coding so we can tweak with it. The collowing are the lines we are wondering what are they for. Please just give a super brief of each line:
1. user32.dll
2. UserForm1.gridItemsFound.G
3. .AddColumn vKey:="ID", sheader:="ID", lcolumnwidth:=20, bVisible:=False
4. .ColumnOrder(1) = GetSetting(Application.Nam
5. .ColumnWidth(1) = GetSetting(Application.Nam
6. .ColumnOrder(2) = GetSetting(Application.Nam
7. .ColumnWidth(2) = GetSetting(Application.Nam
8. .ColumnOrder(nCol) = GetSetting(Application.Nam
9. lColIndex(i_SUBJECT) = .ColumnIndex("Subject")
10. Session.Application.Active
11. UserForm1.Caption = GetSetting(Application.Nam
12. txtSearch.Text = GetSetting(Application.Nam
13. nSelectedRow = GetSetting(Application.Nam
14. nSelectedCol = GetSetting(Application.Nam
15. UserForm1.MousePointer = fmMousePointerHourGlass
16. gridItemsFound.Sort
17. UserForm1.MousePointer = fmMousePointerDefault
Busy getting answers for you...
Stand By...
Cheers
Chris
Stand By...
Cheers
Chris
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Wow! Thank you very much!
But didn't see answers for questions
9. lColIndex(i_SUBJECT) = .ColumnIndex("Subject")
10. Session.Application.Active Explorer.A ctivate
Please advice
But didn't see answers for questions
9. lColIndex(i_SUBJECT) = .ColumnIndex("Subject")
10. Session.Application.Active
Please advice
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Just got a chance to escape... we are in closing.
Thanx for the explanations; great info! You just helped us jump from point A to point B with breeze.
Thanx for the explanations; great info! You just helped us jump from point A to point B with breeze.
Stand By...
Chris