VB5/Access 97- PERFORMING SEARCHES ON THE DBGRID 
Author Message
 VB5/Access 97- PERFORMING SEARCHES ON THE DBGRID

I have a DBGrid, a Combo Box to select search field (dbCombo1) and a text
box to receive search text (txtsearch).

        cmdSearch_Click()

                If dbCombo1.Listindex = 0 Then
                        sSQL = "SELECT * FROM table"
                        sSQL = sSQL & " WHERE field = "
                        sSQL = sSQL & chr(34) & txtSearch & chr(34)
                        sSQL = sSQL & " ORDER BY field"
                        Data1.RecordSource = sSQL
                        Data1.Refresh
                End If

        QUESTION

1.      The user will not always know the exact text to enter into txtSearch or
will not always
        want to type-in the complete word.  Therefore, how do I get txtSearch to
include wildcards       before and after the text entered, ie if txtSearch =
"An" the DBGrid would show records
        matching Andy, Andrew, Brian or Nathanial.

2.      How do I get txtSearch to show all records containing text entered in
txtSearch, ie if
        txtSearch = "Louise" the DBGrid would show records matching Louise, Emma
        Louise, Mary Louise.



Mon, 06 Mar 2000 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Performing Access '97 Functions in VB5

2. Unable to Update in VB5.0 DBGrid from Stored Query in Access 97

3. VB5 / ACCESS '97 Database and DBGrid AllowAddNew Property

4. dbgrid - dynamic columns in VB5 & access 97

5. VB6 - DAO - Access 97 - Getting status at real-time when performing a query

6. Using a Data Control in VB5 accessing a user-level secure Access 97 DB

7. Convcert Access 2.0->Access 97 with VB5

8. Searching Table from Module: Access 97

9. search and replace in Access 97

10. Searching for a set of record in Outlook 98 and Access 97

11. Fix for Access 97's search and replace

12. Searching Access 97

 

 
Powered by phpBB® Forum Software