Results 1 to 6 of 6

Thread: ***RESOLVED****need some coding help

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2002
    Location
    Georgia
    Posts
    337

    ***RESOLVED****need some coding help

    How do I add ORDER BY [AdjusterLastName] in the following ??

    Adodc1.Recordset.Filter = "AdjusterLastName = '" & DataCombo1.Text & "'"

    Thanks for any and all help
    Last edited by Tailgun; Sep 28th, 2002 at 06:18 PM.

  2. #2
    Hyperactive Member ZeroCool's Avatar
    Join Date
    Feb 2002
    Location
    In front of my computer
    Posts
    423
    Isn't that a SQL Command?
    Visual Baisc 6 (SP5)
    Windows Xp

  3. #3
    Hyperactive Member ZeroCool's Avatar
    Join Date
    Feb 2002
    Location
    In front of my computer
    Posts
    423
    I Think This is what you want

    VB Code:
    1. adodc1.Recordset.Open "Select * From Table ORDER BY [AdjusterLastName]
    Visual Baisc 6 (SP5)
    Windows Xp

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2002
    Location
    Georgia
    Posts
    337
    yes it is a SQL command but if I use

    adodc1.Recordset.Open "Select * From Table ORDER BY [AdjusterLastName]

    It works fine till I filter the recordset then it will not ORDER BY

    I have to filter the recordset since the user selects a Client and based on that client only those Adjusters associated with that client appear in the DataCombo Adjusters list hence the original problem where the recordset is filtered by a Client DataCombo.

    I dunno why it doesn't maintain the original ORDER BY when it is later filtered

  5. #5
    Junior Member
    Join Date
    Aug 2002
    Location
    Brazil
    Posts
    29
    TailGun

    I had a situation like this before and solved closing the recordset and reopening with the filter and the ordering.
    VB Code:
    1. adodc1.Recordset.Close
    2. adodc1.Recordset.Open "Select * From Table WHERE AdjusterLastName = '" & DataCombo1.Text & "' ORDER BY [AdjusterLastName]"

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2002
    Location
    Georgia
    Posts
    337

    Thumbs up

    thanks LucianoBraatz
    that did the trick

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