Results 1 to 9 of 9

Thread: Urgent help needed to "Filter" the data...

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2005
    Posts
    69

    Urgent help needed to "Filter" the data...

    Hi,

    Can somebody modify this code so that I can filter the data by "Customer Name" "Sales Person" & "City".

    The following is the code:
    Note: Here in this code "fname" & "lname" or the names of Option Buttons. And Text9 is the Text Box where user can enter the text to filter.
    VB Code:
    1. Private Sub Text9_Change()
    2. rs.Close
    3. If fname.Value = True Then
    4.     rs.Open "Select * from dept where fname like '" & Text9 & "%'", db
    5.     rs.Requery
    6. Else
    7.     rs.Open "Select * from dept where lname like '" & Text9 & "%'", db
    8.     rs.Requery
    9. End If
    10.  
    11. If rs.RecordCount <> 0 Then
    12.     show_rec
    13. Else
    14.     clear_txt
    15. End If
    16. End Sub

    Thanks in advance for any help.

    sweetie_2005





    Edit: Added [vbcode][/vbcode] tags and indenting for clarity. - Hack
    Last edited by Hack; Oct 11th, 2005 at 06:04 AM.

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