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!

orderby on a boolean field

Status
Not open for further replies.

tania20

Programmer
Oct 30, 2006
148
0
0
AU
Hi, Ive got a set of records that I want to display according to a check box field. I can get it to sort OK but it displays the checked records first, and I want it the other way around. Ive tried using DESC and ASC but it doesnt work. Any suggestions? Thanx
 
Please post the filter that you tried.
 
I tried a range of things...

"fieldname DESC"
fieldname DESC

both in properties and by using OrderbyOn in code
 
Did you try without the quotes? How are you applying this filter?
 
yep i tried with and without quotes in properties and code:

' Me.sfCurrent.Form.OrderBy = "ViewResult DESC"
' Me.sfCurrent.Form.OrderByOn = True
 
Are you sure you have the name of the subform control, rather than the form contained by the control?
 
I use the same when I am applying a filter and that works fine....
 
When you use the buttons on the toolbar to sort decending, what do you get in the OrderBy property of the subform?

I find a mock-up works for me, which is why I am puzzled.
 
The following is returned tblSummaryInfo.ViewResult DESC, where the recordsource of the form is tblSummaryInfo....
 
Well, its a long shot, but you could try that:

Me.sfCurrent.Form.OrderBy="tblSummaryInfo.ViewResult DESC"
Me.sfCurrent.Form.OrderByOn=True
 
Ive tried that and it still doesnt work. For some reason its ordering even when i remove the code and property reference.Very baffled!
 
It looks as if some other code may be interfering. How about trying a test form with nothing but the subform and the order by code?
 
that thought just occured to me...and sure enough....there was some other code overwriting this in a pop-up form!! thanks for yr help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top