If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Subform sort order problem
I have a form/subform. They are linked on the field 'cnum'. The fields in
the table 'Received' which is what the subform is bound to a Cnum Ldate Lbs Furniture Clothes Council The 'OrderBy' = received.ldate DESC and 'OrderByOnLoad' = yes However, when subform opens the records are sorted in ascending order. To check this I put the following into the 'Current' event of the form: Debug.Print Me.OrderBy, Me.OrderByOn, Me.OrderByOnLoad The results of this a ldate DESC False True ldate DESC False True ldate DESC False True ldate DESC False True In order for it to sort in the descending order, I put the following into the 'Current' event of the form: Me.OrderByOn = True which yields: ldate DESC False True ldate DESC True True ldate DESC True True ldate DESC True True ldate DESC True True One point which may be of importance is that I took this form and most every object from a corrupted dB using the technique outlined by Allen Browne. I also was fairly certain that I did not pull the corrupting form into the new dB. Thanks |
#2
|
|||
|
|||
Subform sort order problem
Instead of applying the sort to the form, why not create a sorted
recordsource for the form, that is, create a query as the record source for the subform and sort it there. -- --Roger Carlson MS Access MVP Access Database Samples: www.rogersaccesslibrary.com Want answers to your Access questions in your Email? Free subscription: http://peach.ease.lsoft.com/scripts/...UBED1=ACCESS-L "Anthony Spatuzzi" wrote in message ... I have a form/subform. They are linked on the field 'cnum'. The fields in the table 'Received' which is what the subform is bound to a Cnum Ldate Lbs Furniture Clothes Council The 'OrderBy' = received.ldate DESC and 'OrderByOnLoad' = yes However, when subform opens the records are sorted in ascending order. To check this I put the following into the 'Current' event of the form: Debug.Print Me.OrderBy, Me.OrderByOn, Me.OrderByOnLoad The results of this a ldate DESC False True ldate DESC False True ldate DESC False True ldate DESC False True In order for it to sort in the descending order, I put the following into the 'Current' event of the form: Me.OrderByOn = True which yields: ldate DESC False True ldate DESC True True ldate DESC True True ldate DESC True True ldate DESC True True One point which may be of importance is that I took this form and most every object from a corrupted dB using the technique outlined by Allen Browne. I also was fairly certain that I did not pull the corrupting form into the new dB. Thanks |
#3
|
|||
|
|||
Subform sort order problem
On Wed, 2 May 2007 09:18:19 -0400, Roger Carlson wrote:
Instead of applying the sort to the form, why not create a sorted recordsource for the form, that is, create a query as the record source for the subform and sort it there. I must have misstated the question. In code I can get it to sort correctly by setting the 'Me.OrderByOn = true' in the oncurrent event of the form. However, this should not be necessary as I have used this form/subform combination before and it behaves as I desire ie; if I want an ascending sort I get an ascending sort and if I want a descending sort I get a descending sort via the form's properties. The output of the debug.print shows that the 'orderby' property is false when it should be true. Thanks |
Thread Tools | |
Display Modes | |
|
|