Kamis, 21 Mei 2015

Re: [MS_AccessPros] Detecting sort order on form

 

John,


That sets it. I'm asking how to detect what it. Do I do something like the following?

If Form.OrderBy = "TotalRev DESC" Then Form.OrderBy = "TotalRev" Else Form.OrderBy = "TotalRev DESC"

Adam

---In MS_Access_Professionals@yahoogroups.com, <JohnV@...> wrote :

Adam-

In code behind the form:

    Me.OrderBy = "[OrderDate]"
    Me.OrderByOn = True


John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
SQL Queries for Mere Mortals 
(Paris, France)




On May 21, 2015, at 5:36 PM, runuphillracing@... [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:

John,


How do I do that in VBA? I know how to set it - "Form.OrderBy =" - and how to turn it on and off - "Form.OrderByOn =" - but not how to find out what they are.


Adam



---In MS_Access_Professionals@yahoogroups.com, <JohnV@...> wrote :

Adam-

Check the form's OrderBy and OrderByOn properties.

John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
SQL Queries for Mere Mortals 
(Paris, France)




On May 21, 2015, at 4:24 PM, runuphillracing@... [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:

    

How can I detect the sort order on a continuous form? I have several columns they can sort on by clicking on the column head. I'd like to be able to reverse the sort order by clicking on the header again.  Is there a way to detect the current sort order? I would prefer something like that over my alternate, clumsy ways of doing this:

  1. Write the sort column and order into a not visible, unbound, text field.
  2. Using single click for ascending, double for Desc

Thanks


Adam



__._,_.___

Posted by: runuphillracing@yahoo.com
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (5)

.

__,_._,___

Tidak ada komentar:

Posting Komentar