Results 1 to 3 of 3

Thread: Database Search Solution

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2005
    Posts
    6

    Database Search Solution

    Im currently trying to implement a search function into my program, form is as shown in attachment. I am using a data environment with a command that has a relationship to my car table and an sql statement as shown below

    SELECT * FROM Car WHERE car_registration_plate LIKE '" & TxtSearch.Text & "*'

    I then have the code below for the command button oviously nothing shows in the datagrid to begin with but when text is entered and the search button clicked it should show the record from the text that is entered, when i change the txtsearch bit in the code above to a record in my table it shows that record in the datagrid upon form load up, so i dont know why it doesnt show it when the text is entered

    Search command button

    Private Sub cmdsearch_Click()
    Dim strSearch As String
    Dim SQLString As String

    DataGrid1.Refresh

    End Sub

    Can anyone help, iv been trying to solve it for hours
    Attached Images Attached Images  

  2. #2
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: Database Search Solution

    VB Code:
    1. Private Sub cmdsearch_Click()
    2. Dim strSearch As String
    3. Dim SQLString As String
    4. [B]Set DataGrid1.Recordset= DataEnvironment1.....[/B]
    5. End Sub
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2005
    Posts
    6

    Re: Database Search Solution

    New Code

    Private Sub cmdsearch_Click()

    Dim StrSearch As String
    Dim SQLString As String

    TxtSearch = StrSearch
    Set DataGrid1.Recordset = DataEnvironment1.CarSearch

    DataGrid1.Refresh

    End Sub

    When Run i get an error saying:
    Complile Error:
    Method or data member not found

    Tried changing the code to:
    Set DataGrid1.DataSource = DataEnvironment1.CarSearch

    But still no joy, what else could it be?

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