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

Sort by Column Instead of Field

Status
Not open for further replies.

kcmark

Technical User
Nov 2, 2002
63
0
0
US
I am working with a continuous form and am adding a sort feature to the column headings. There are 5 columns in my form and I want the user to be able to click on the header and sort the data by that field. I can do this when the column contains a field that pulls directly from the query, but I have a couple of columns that are calculations and cannot get the sort to work for these columns. I am using the following code with the OnClick event (which works great for non-calculation fields):

Me.OrderBy = "[Trans_Date]"
Me.OrderByOn = True

Any ideas on how I can sort by the calculation fields?

 
Can you move the calculation into the source query for your form, than treat it the same as your other columns?

C
 
Thanks! It worked like a charm - why didn't I think of that?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top