PDA

Click to See Complete Forum and Search --> : recordsource change at runtime


Sep 16th, 2000, 05:36 AM
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

DrewDog_21
Sep 16th, 2000, 10:48 AM
That is not hard, and you can do it with the ADO data control using the FILTER property.

Private Sub Command1_Click()

If Text1 = "" then Exit Sub

Adodc1.Recordset.Filter = "MyField = '" & Text1 & "'"
DataGrid1.Refresh

End Sub

Sep 24th, 2000, 01:08 AM
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