Results 1 to 3 of 3

Thread: recordsource change at runtime

  1. #1
    Guest
    I am using an ado control
    and a data grid. i want to change the values of the data grid based upon a value the user inputs like for name 'sam ' so that all the values in a column having sam in it are shown in the data grid.
    can i do this with a ado data control or do i have to write the code for ado pls help on how to
    pls also explain how to search for the string by using the text1.txt value ie the quotes etc

  2. #2
    Hyperactive Member
    Join Date
    Nov 1999
    Location
    Columbia, SC USA
    Posts
    374

    Wink

    That is not hard, and you can do it with the ADO data control using the FILTER property.
    Code:
    Private Sub Command1_Click()
    
    If Text1 = "" then Exit Sub
    
    Adodc1.Recordset.Filter = "MyField = '" & Text1 & "'"
    DataGrid1.Refresh
    
    End Sub

  3. #3
    Guest

    Question recordset returns no value

    i tried that but the adodc.recordset.filter =0 and so when i execute it it just stays there and the data grid does not change

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