Results 1 to 2 of 2

Thread: Filter DATAGRID?? how?

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2002
    Posts
    8

    Filter DATAGRID?? how?

    ok i done a datagrid with adodc ...
    so i have a combobox to choose a name then click "ok"
    later i want the combobox = name .....so it will show in the data grid with the name that choosen..

    I'm newbie ..help fast

  2. #2
    Member
    Join Date
    Feb 2003
    Location
    Cincy
    Posts
    55
    Here ya go!!!

    VB CODE----------------------------------------------------------------
    Private Sub cmdOK_Click()
    If Adodc1.Recordset.EOF = False And Len(cboYourCombo.Text) Then
    Adodc1.Recordset.Filter = "YourField Like '" & cboYourCombo.Text & "'"

    If Adodc1.Recordset.RecordCount = 0 Then
    MsgBox "sorry no match found, try again!!", vbExclamation
    Adodc1.Refresh
    cboYourCombo.SetFocus
    End If
    End If
    DataGrid1.Refresh
    End Sub
    END CODE_______________________________________

    This should work..Let me know if any explaination is needed.
    Last edited by Fleck; Jun 5th, 2003 at 01:25 PM.

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