I have several subforms (datasheet mode), each with a date. The default dates are that of the system but they can be altered at will by the user. I want these dates to remain sorted descending, that is, the most recent date first and later dates in the subsequent rows. Although I entered Subform.[Date] DESC in the subforms Design View "Order by" it keeps mixing up every time I open the main form. I guess the subform sorts by real input date and not by date given in the date control. How can I force descending sort for the dates as in the control?
How to maintain a dates on subforms descending sorted
Collapse
X
-
Consider basing the recordsource of your subform on either a saved query that sorts by the date you require descending or an SQL statement typed directly into the recordsource property of the form. so the recordsource of your subform should look something like either one of theseOriginally posted by EricksI have several subforms (datasheet mode), each with a date. The default dates are that of the system but they can be altered at will by the user. I want these dates to remain sorted descending, that is, the most recent date first and later dates in the subsequent rows. Although I entered Subform.[Date] DESC in the subforms Design View "Order by" it keeps mixing up every time I open the main form. I guess the subform sorts by real input date and not by date given in the date control. How can I force descending sort for the dates as in the control?
Record source: qryTheNameOfMyS avedQuery
OR
Record source: SELECT fieldname1,fiel dname2,MyDate1 FROM tblMyTable ORDER BY MyDate1 DESC;
Regards
Jim -
Originally posted by Jim DohertyConsider basing the recordsource of your subform on either a saved query that sorts by the date you require descending or an SQL statement typed directly into the recordsource property of the form. so the recordsource of your subform should look something like either one of these
Record source: qryTheNameOfMyS avedQuery
OR
Record source: SELECT fieldname1,fiel dname2,MyDate1 FROM tblMyTable ORDER BY MyDate1 DESC;
Regards
Jim
Thanks Jim. Gosh do I feel stupid. Somehow I wanted the Form to be based on the table so I kept staring myself blind on that. So I made a query and now it works. I guess you're not surprised I chose that Avatar...
Thanks again,
EricComment
-
Ahahahaha you know something I did look at that and I thought "now you know something?" this person is coolOriginally posted by EricksThanks Jim. Gosh do I feel stupid. Somehow I wanted the Form to be based on the table so I kept staring myself blind on that. So I made a query and now it works. I guess you're not surprised I chose that Avatar...
Thanks again,
Eric
Jim :)Comment
Comment