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

Sorting problem?

Status
Not open for further replies.

Buj123

Programmer
Jan 5, 2004
96
US
Hi Everyone,
I have problem in Sorting.

I have a form where there will be 3 combo boxes like below

Sort By ......
Filter By ..... or ......

For that i have wriiten a query like below, but this workes for Filter, How to write the order by

SELECT tblProjects.OverallScore, tblProjects.Team, tblProjects.ProjectStatus,tblProjects.ProductDescription, tblProjects.PrimaryContact, tblProjects.PrimaryContactDepartment, tblProjects.TargetRollOut, tblProjects.Notes, tblProjects.IntangibleScore
FROM tblProjects
WHERE (((tblProjects.ProjectStatus)=Forms!frmManagerReview!Text11)) Or (((tblProjects.PrimaryContact)=Forms!frmManagerReview!Text13)) Or (((tblProjects.PrimaryContactDepartment)=Forms!frmManagerReview!Text15));

I have tried this but didnot worked out

Order by Forms!frmManagerReview!Text17 Desc;

Please help
 
Provided the query is the RowSource of ypur form, you may consider something like this (in the AfterUpdate event procedure of the SortBy textbox):
Me.OrderBy = Me!txtSortBy.Value & " DESC"
Me.OrderByOn = True
Me.ReQuery


Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top