Repost - Sort Order being lost

  • Thread starter Thread starter Noel
  • Start date Start date
N

Noel

Hi. Didnt have any replies to this a few days ago. Heres
another try.

Im having a problem with a subform losing its sort
order. In the subforms Order By property I have put the
following:

[Placements Subform].Placements.txtPlacementStageOrder
Desc

The problem is this whole line keeps dissapearing. It may
be something to do with my continually working on the db,
doing new reports etc. But I havent been makaing any
changes to this specific subform. Perhaps Im doing this
the wrong way. Any ideas how I can lock this in somehow?
Maybe some code in the subforms On Open Event? Cheers,
Noel
 
You can only sort by a field that exists in the form'sRecordSource.

If "txtPlacementStageOrder" is the name of a field in the subform's
RecordSource, you could set the subform's OrderBy property to:
txtPlacementStageOrder DESC
and be sure to turn on its OrderByOn property.
 
Thanks for the reply Allen. I'll have a look at this in
work tomorrow. Cheers, Noel
-----Original Message-----
You can only sort by a field that exists in the form'sRecordSource.

If "txtPlacementStageOrder" is the name of a field in the subform's
RecordSource, you could set the subform's OrderBy property to:
txtPlacementStageOrder DESC
and be sure to turn on its OrderByOn property.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Hi. Didnt have any replies to this a few days ago. Heres
another try.

Im having a problem with a subform losing its sort
order. In the subforms Order By property I have put the
following:

[Placements Subform].Placements.txtPlacementStageOrder
Desc

The problem is this whole line keeps dissapearing. It may
be something to do with my continually working on the db,
doing new reports etc. But I havent been makaing any
changes to this specific subform. Perhaps Im doing this
the wrong way. Any ideas how I can lock this in somehow?
Maybe some code in the subforms On Open Event? Cheers,
Noel


.
 
Hi again Allen. Very sorry for not getting back to you
til now. I cant find an OrderByOn property. Where should
I be looking? Thanks again, Noel
-----Original Message-----
You can only sort by a field that exists in the form'sRecordSource.

If "txtPlacementStageOrder" is the name of a field in the subform's
RecordSource, you could set the subform's OrderBy property to:
txtPlacementStageOrder DESC
and be sure to turn on its OrderByOn property.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Hi. Didnt have any replies to this a few days ago. Heres
another try.

Im having a problem with a subform losing its sort
order. In the subforms Order By property I have put the
following:

[Placements Subform].Placements.txtPlacementStageOrder
Desc

The problem is this whole line keeps dissapearing. It may
be something to do with my continually working on the db,
doing new reports etc. But I havent been makaing any
changes to this specific subform. Perhaps Im doing this
the wrong way. Any ideas how I can lock this in somehow?
Maybe some code in the subforms On Open Event? Cheers,
Noel


.
 
The OrderByOn property is not in the Properties box. You set it in code.

Example:
Private Sub Form_Open(Cancel As Integer)
Me.OrderBy = "[PutNameOfSomeFieldInHere] DESC"
Me.OrderByOn = True
End Sub

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Noel said:
Hi again Allen. Very sorry for not getting back to you
til now. I cant find an OrderByOn property. Where should
I be looking? Thanks again, Noel
-----Original Message-----
You can only sort by a field that exists in the form'sRecordSource.

If "txtPlacementStageOrder" is the name of a field in the subform's
RecordSource, you could set the subform's OrderBy property to:
txtPlacementStageOrder DESC
and be sure to turn on its OrderByOn property.

Hi. Didnt have any replies to this a few days ago. Heres
another try.

Im having a problem with a subform losing its sort
order. In the subforms Order By property I have put the
following:

[Placements Subform].Placements.txtPlacementStageOrder
Desc

The problem is this whole line keeps dissapearing. It may
be something to do with my continually working on the db,
doing new reports etc. But I havent been makaing any
changes to this specific subform. Perhaps Im doing this
the wrong way. Any ideas how I can lock this in somehow?
Maybe some code in the subforms On Open Event? Cheers,
Noel
 
Ahhh I see. Excellent. Thanks Allen. Thats exactly what I
want - this On Open code wont dissapear like my other code
does. Thanks, Noel
-----Original Message-----
The OrderByOn property is not in the Properties box. You set it in code.

Example:
Private Sub Form_Open(Cancel As Integer)
Me.OrderBy = "[PutNameOfSomeFieldInHere] DESC"
Me.OrderByOn = True
End Sub

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Hi again Allen. Very sorry for not getting back to you
til now. I cant find an OrderByOn property. Where should
I be looking? Thanks again, Noel
-----Original Message-----
You can only sort by a field that exists in the form'sRecordSource.

If "txtPlacementStageOrder" is the name of a field in the subform's
RecordSource, you could set the subform's OrderBy property to:
txtPlacementStageOrder DESC
and be sure to turn on its OrderByOn property.

Hi. Didnt have any replies to this a few days ago. Heres
another try.

Im having a problem with a subform losing its sort
order. In the subforms Order By property I have put the
following:

[Placements Subform].Placements.txtPlacementStageOrder
Desc

The problem is this whole line keeps dissapearing. It may
be something to do with my continually working on the db,
doing new reports etc. But I havent been makaing any
changes to this specific subform. Perhaps Im doing this
the wrong way. Any ideas how I can lock this in somehow?
Maybe some code in the subforms On Open Event? Cheers,
Noel


.
 
Back
Top