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

Sorting by field

Status
Not open for further replies.

fatstu

Technical User
Feb 22, 2002
20
US
Im looking to sort a repeat region by the date field as default. Easily done i.e. ORDER BY date. I want to add functionality that lets you sort by other fields e.g. name, address etc etc. Going back to the ORDER BY [field] statement, is it possible to make this dynamic? Or would I need to physically make the additional pages with differing recordsets?

 
you could add a checkbox or radiobutton to allow the user to pick the sort.

i believe it is also possbile to sort dymanically clientside by using javascript and getrow functionality, but the js would be pretty complex

hth

Bastien

There are many ways to skin this cat,
but it still tastes like chicken
 
id prefer server side to be honest
 
Have a select box with your column names in it and on change, post back to the same page. In your SQL statement, use the value from the select box to determine the order by:

If Len(varColumn)=0 then 'no value chosen in select box
SQL = "SELECT * FROM Table Order by Date" 'default order by
Else
SQL = "SELECT * FROM Table Order by " & varColumn
end if

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top