Link to home
Start Free TrialLog in
Avatar of jana
janaFlag for United States of America

asked on

How to sort a column in vbAccelerator DataGrid used in Outlook 2007 VBA

We have vbAccelerator DataGrid being used in our Outlook 2007 via VBA.

We are trying to make the Grid be Sorted by the column the user clicks on.  

What is the best method to go about it?
Avatar of Chris Raisin
Chris Raisin
Flag of Australia image

Ok...I'm awake still!  :-)


Sorting is always performed via the SortObject

Do you want to sort on ONE column only?

We could perhaps RIGHT click to set the column to be sorted then LEFT click to have it toggel between ASCENDING and then DESCENDING.

What would you like?

Cheers
Chris
Avatar of jana

ASKER

Hey!!! We though you would be counting sheeps!!

We need that when the user clicks on 'Tasks', the current grid would sort A-Z it's contents by 'Tasks'.  If the user clicks again, would revert the sort Z-A.
OK...working on it (sleep-typing...not sleep-walking)

Stand By...

Chris
Do you want it to be ONLY for that column, or for any column the user picks?

Cheers
Chris
Avatar of jana

ASKER

any column
ASKER CERTIFIED SOLUTION
Avatar of Chris Raisin
Chris Raisin
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jana

ASKER

Ok will check...
Avatar of jana

ASKER

Worked excellently!
Would you like multiple columns?

Cheers
Chris  (snore!....snore!....zzzzzz....zzzzz)
Avatar of jana

ASKER

By multiple columns, what do you mean specifically?
Well, when you click on (say) "Projects" then the order could be Tasks sorted alphabetically (does not make much sense) within project, and then "Subject" within each Task.

I think in this exercise it does not make much sense to have multiple sorts, unless you perhaps introduce a "Priority" field such as "1" (Urgent), "2" (high),"3" Medium, "4" (Low),  "5" (Very Low) and then the tasks could be sorted on their priority within a project.

Anyway, I will look at how the sorting works and even if you do not use it, at least I will have that info should others need it at any time.

I think though that since it is quite involved, it should be asked as a new question (should you feel you would like it). I have basically answered this question already.

Did you look at the final code I left in the other question? I think you will find it very beneficial should the user want to actually view the email "double-clicked" upon in the grid.


Cheers
Chris


Cheers
Chris
Avatar of jana

ASKER

I talked to my boss and the current sorting already provided is enough.

We have been running the apps and a series of question surfaced, but will open a new question for that.  This question on sorting has been answered.

Thanx
OK - I will keep my eyes peeled :-)

Cheers
Chris
Avatar of jana

ASKER

We placed a couple of question regarding sorting and headers.  Please advice
Have done and am responding.

I have set up a special filter so that whenever you submit a new question, I receive an email advising me of it - EE works pretty efficiently, eh?  :-)

Cheers
Chris
Avatar of jana

ASKER

Yes it does!  That is why I stick to EE!