Database Programming Techniques > Searching Bookmarks Using the Find Method > Find Method Simple Code Example: |
The following code searches from the beginning of the control for any bookmark in the “Date” column with a date greater than “10/21/98”.
Example Title |
Copy Code
|
---|---|
Private Sub cmdFind_Click() dim bk bk = TDBList1.Columns("Date").Find("10/21/98", dblSeekGT, True) End Sub |
As you can see in the bold faced section of code we have:
set the SearchStr to “10/21/98”
set the SearchMode to dblSeekGt which will enable the search for numeric dates greater than 10/21/98
set the IncludeStart to True and have not specified a StartBmk which causes the default StartBmk to be the first row in the control
If you wish to search from a specific row, you would set IncludeStart to True and set StartBmk to the row where you wish to start the search.
If you wish to create a continuing search, where your SearchStr is repeated in the control (more than one instance of your string), you would set IncludeStart to False and set StartBmk to the previous incident of your Find.
For more information, see Tutorial 22 - Performing a List Search Using the Find Method.