Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with Sort scripts 1

Status
Not open for further replies.

Tearose

IS-IT--Management
Jan 12, 2005
241
US
I have a huge database that I would like to be able to sort in two different ways (one by Name, the other by Location) by using buttons to run the scripts. The default sort is by location (I already have that button). How can I script the button to make it sort by Name?
 
Make a 'manual' sort on the name field.

Make your script 'Sort by name' - restore sortoption.
Now you can go two ways.
Using two buttons - one for the Location sort and one for the Name sort.

Or you can label the button and by scripting changing the sort by Location or Name.

Both scripts will need something along these lines (pseudocode):
If (buttonlabel) ='Location'
set (buttonlabel) = 'Name'
with the rest of the Name sort script.

Do the same for the Location sort script...
If (buttonlabel) = 'Name'
set (buttonlabel) = 'Location' etc...

I think you have the idea, play around with it and discover...

HTH

JW
 
Thanks, I've got the buttons working right, now.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top