OrderBy Form Property

  • Thread starter Thread starter swagar
  • Start date Start date
S

swagar

Guest
On some button events I set filter and orderby properties on. When I close the form I want to set the properties off. Even though I have written the statements properly, the orderby immediately executes the next time the form is opened. Can anyone give me another way of doing this? or explain why this is happening?
 
Hi,

Because the properties are set in design, changing them in code only effects this instance of the form. To get the property to stay off till you want it you must set the proprty in code in the same way as you change it in code.

Hope that makes sense
Robin.
 
Robin, thanks for responding to my problem. I am however already trying to turn the orderby off in code. Any other suggestions ?Here is an excerpt:

Private Sub Form_Load()

Me.OrderBy = ""
Me.OrderByOn = False

End Sub
 
Hi Swagger

I may be missing something, but your coding seems to contradict internally what you want to achieve.

I think you may need one or the other line but not both in the way you have done it.

Me.OrderBy = ""
Me.OrderByOn = False

The first line sets the "OrderBy" property to a null value (so it won't sort on anyhting) but then you set the "OrderByOn" property to "False" (so doesn't this negate the earlier command?)

Try

Me.OrderBy = ""
Me.OrderByOn = True

I hope that helps

Rich
 
Thanks for the input. I have tried setting orderby to null and orderbyon to true. This still did not work. It seems once I set the orderby, orderbyon properties in code, the form properties are updated, then in the next form load they do not get set back by any statements Form load subroutine. The design properties for the form will still contain the old order by string.
 

Users who are viewing this thread

Back
Top Bottom