By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,486 Members | 2,124 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,486 IT Pros & Developers. It's quick & easy.

How to maintain a dates on subforms descending sorted

Ericks
P: 74
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?
Oct 11 '07 #1
Share this Question
Share on Google+
3 Replies


Jim Doherty
Expert 100+
P: 897
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?
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 these

Record source: qryTheNameOfMySavedQuery

OR

Record source: SELECT fieldname1,fieldname2,MyDate1 FROM tblMyTable ORDER BY MyDate1 DESC;

Regards

Jim
Oct 11 '07 #2

Ericks
P: 74
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 these

Record source: qryTheNameOfMySavedQuery

OR

Record source: SELECT fieldname1,fieldname2,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,

Eric
Oct 11 '07 #3

Jim Doherty
Expert 100+
P: 897
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,

Eric
Ahahahaha you know something I did look at that and I thought "now you know something?" this person is cool

Jim :)
Oct 11 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.