Please Help : Order BY
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 8 of 8

Thread: Please Help : Order BY

  1. #1
    Join Date
    Oct 2000
    Posts
    25

    Angry

    Hi,

    I have a multi row block on my form with fields for (eg. Name, Address etc.)

    2 buttons on the form....

    What I want is at runtime

    - when I click the first button called NAME...it will order the block by NAME

    - When I click the second button called Address it will order the block data by Address...


    Can u help...Im really stuck with this...

    thanks....

    ASH


  2. #2
    Join Date
    Apr 2001
    Location
    UK
    Posts
    137
    Use set_block_property to modify the default "order by" clause and requery.

  3. #3
    Join Date
    Oct 2000
    Posts
    25

    ORDER BY

    Originally posted by nealh
    Use set_block_property to modify the default "order by" clause and requery.
    is there any chance u could help me with the code I have no idea to be honest

    thanks
    aSH

  4. #4
    Join Date
    Sep 2000
    Posts
    47
    Hi Ash,

    Include the following code in WHEN-BUTTON-PRESSED trigger of the NAME button :

    set_block_property(ORDER_BY, 'NAME') ; /*Check Syntax*/
    Execute_Query ;


    Similarly, for Address button :

    set_block_property(ORDER_BY, 'ADDRESS') ; /*Check Syntax*/
    Execute_Query ;

    Hope this helps.


  5. #5
    Join Date
    Oct 2000
    Posts
    25
    THANKS ILL TRY IT OUT THNAKS A LOT
    ASH
    Originally posted by Pinakin
    Hi Ash,

    Include the following code in WHEN-BUTTON-PRESSED trigger of the NAME button :

    set_block_property(ORDER_BY, 'NAME') ; /*Check Syntax*/
    Execute_Query ;


    Similarly, for Address button :

    set_block_property(ORDER_BY, 'ADDRESS') ; /*Check Syntax*/
    Execute_Query ;

    Hope this helps.


  6. #6
    Join Date
    Aug 2000
    Posts
    462
    I would recommend making the buttons toggle between ASC and DESC for the field to be ordered on. For example:

    WHEN_BUTTON_PRESSED Trigger for name button:

    begin
    if get_block_property('BLOCK_NAME',default_where) = 'NAME ASC' then
    set_block_property('BLOCK_NAME', default_where,'NAME_DESC');
    else
    set_block_property('BLOCK_NAME',default_where, 'NAME ASC');
    end;

  7. #7
    Join Date
    Nov 1999
    Location
    Kuwait
    Posts
    122

    Wink

    Dear Ash,

    Are u done with that? If so then forget it else send me the form i will do it for ya..!

    regards,
    NK

  8. #8
    Join Date
    Oct 2000
    Posts
    25

    Thumbs up

    Originally posted by nabeel
    Dear Ash,

    Are u done with that? If so then forget it else send me the form i will do it for ya..!

    regards,
    NK
    Yes that worked like a treat...thanks a lot appreciate it

    ASH

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width