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!

Sorting Order

Status
Not open for further replies.

kentwoodjean

Technical User
Oct 19, 2002
376
0
0
US
I have a form with a subform included. The subform has a field for the month/year. In other words, my boss wants the field to appear as: January 2002, February 2002, etc through 2003. Another field shows the forecasted number and as each month passes, I will populate the Actuals field.

Problem is that no matter how hard I try, the months will not stay in order Jan - Dec 2002, and then Jan - Dec 2003 following. the months want to group together and whethere it is ascending or descending, January doesn't even end up at the top. Obviously, something more must be done. Can someone tell me what that is?
 
The underlying table or query controls the sort order of the way the records are displayed in the subform. If you are using a query as the subforms Record Source then you should be able to change the sort order in the query. The field that holds the January 2001, etc should be a date field with the date being displayed with a format mask to that indicated. If not you will only be sorting on the text representation order which will never be anything near a date order.

Come back with more infomation about the table, query, and field and I can help you with this further. Bob Scriver
 
mthno:Format("03 jan 2003","mm")

mthno:Format([TRANSDATE],"mm")

use the mthno as a field in the query and then use this field as the sort and group break on mthno field

 
sngsng: Yes that will format the info if the field is in fact a date field. From what he is telling us it sounds like the field may be a text string and he is somehow putting a string literal in the field and sorting on that. The Format function will not help if that is the case. That is why I have asked him to identify the datafields and data type.
Bob Scriver
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top