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

Question on ServerFilter property 1

Status
Not open for further replies.

batteam

Programmer
Sep 12, 2003
374
0
0
US
Am trying to develop a bound form to display filtered records from a SQL table using a stored procedure as a record source in an Access 2000 adp project. The form and Stored Procedure are no problem. My questions is: What is the best way to give the user the ability to SORT the records, not filter them, by column of their choice. For example, if my form shows client names and a date field, is there a way to have the user click something that would sort the displayed records by name, then click something again that would sort them by date? Or is it necessary to have two stored procedures for this, with each one having a different Order By clause?

Does the ServerFilter property do this? Seems like it only filters data. I need a way to sort it in various ways once its displayed on the form.
Any help would be appreciated.
 
You could pass a parm to the stored procedure to indicate the Order By field(s).

It will be necessary to build the sql dynamically in the stored procedure.

AS
@SortOrder varchar(100)

Declare mySQL varchar(4000)

select "Select fld1, fld2 from mytable " + @sortOrder

ExecSQL (mySQL)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top