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

Help with parameter 1

Status
Not open for further replies.

Gramm

Instructor
May 16, 2003
92
US
Greetings. I would like to use a parameter to select sort order. For example the user could choose to sort by last name of customer or by City or by zone. The HELP on parameters alludes to this but I can find no info on the how to's of it. Any ideas?? Thanks in advance.
 
There are a couple of ways to do this but the easiest (for me) is to pass the parameter to a stored procedure where it can be inserted into the SQL satatement ORDER BY clause

If you have 3 fields that the user can choose to sort on:

Turnover
Costs
Profit

Then in your SQL string, you can add

Set strSQL = "Some SQL Statement without an ORDER BY Clause"

Set strSQL = strSQL + ' Order By ' + ParamVaraible


Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top