|
-
Jan 4th, 2000, 06:29 PM
#1
Thread Starter
New Member
I have a search facility on a flexgrid. When the search results are returned, the coding I have shows the search text highlighted within the flexgrid. However, the rows that do not contain the search text are also shown. How can I show only those rows which contain the search text?
-
Jan 5th, 2000, 02:53 AM
#2
Guru
I don't believe that the flexgrid has a FILTER property.....I suppose you could follow this pseudocode:
DO UNTIL (LAST ROW IN GRID)
IF CONDITION = FALSE THEN (REMOVE ROW)
LOOP
Just my 2 cents
-
Jan 5th, 2000, 08:20 AM
#3
Member
You can set your flexgrid's datasource property to an ADO recordset. Then all you need to do is change the recordset's filter property and your flexgrid will automatically show the results. For an example, add a hierarchical flexgrid and a couple of command buttons to a form and try the following code.
Code:
Dim cn As New ADODB.Connection
Dim rs As ADODB.Recordset
Private Sub Command1_Click()
rs.Filter = "companyname LIKE 'g%'"
End Sub
Private Sub Command2_Click()
rs.Filter = adFilterNone
End Sub
Private Sub Form_Load()
cn.ConnectionString = _
"Provider=Microsoft.Jet.OLEDB.3.51;Data Source=northwind.mdb"
cn.CursorLocation = adUseClient
cn.Open
Set rs = cn.Execute("SELECT * FROM customers")
Set MSHFlexGrid1.DataSource = rs
End Sub
-
Jan 5th, 2000, 01:26 PM
#4
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|