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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sorting by Column

Status
Not open for further replies.

mattpacman

IS-IT--Management
Nov 14, 2002
6
US
Can anyone explain the best way to sort by column? For example, I would like to place a button over the column headers that, when clicked, sorts the data by the values in that column. (Many commercial programs have this feature).

Thanks in advance,
Matt
 
Make a script for each column you want to sort. For example SortFirstName, SortLastName etc. Put the buttons on top of each column and link them to the appropriate script.

To sort a column use this easy script

Go to Field["ColumnName"]
Sort[No Dialog]

that's it.....

ColumnName: is the field you want to sort
Sort: Restore sort order is UNchecked and Perform without dialog is CHECKED.

I hope this helps.

Chris F
 
Chris,

Thanks, but I still cannot get this to work. I set up the script as you said:

Go To Field ["PayDueDate"]
Sort [No Dialog]

However, I receive an error message that says:

"The previous script step "Sort" could not be completed because it restores an invalid request. Do you wish to continue with this script?"

Option buttons are "Cancel" and "Continue".

I am running FMP 5.5 for Mac.

Am I doing something wrong or is there another way to do this?
 
Matt,
I'm not sure what Chris is saying. (Chris, are you saying that FMP will default to a sort field?)

You need a script for every column heading you want to sort on. Use manual sort to select the field to be sorted, click done, create a script containing a single sort step, save the script.
The script step has both 'Restore' and 'No dialogue' flagged.
Set your column buttons to the relevant script(s).
Cheers,
Paul J.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top