Results 1 to 2 of 2

Thread: [2008] Search field problem

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2009
    Posts
    1

    [2008] Search field problem

    Hi there...

    Using VB 2008 with Access database I'm trying to make a search field (txtSearch), but I'm not getting success with code in the button (cmdSearch)...

    I'm making this manually, not using the Query Builder, and the result will be displayed in a datagridview (added to the form dragging the table from the Datasource Panel). So, the datagrid is already populated (with no SQL)...

    What code must I use for the cmdSearch, to return the txtSearch.Text (or part of it) in the Datagridview ??

    I've tried this:
    "Select Product, Price, Quantity FROM tblProducts WHERE Product LIKE txtSearch.Text & '*'"

    (but it doesn't work)

    Any help will be very appreciated...

    Marcos.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,344

    Re: [2008] Search field problem

    Try running this code:
    Code:
    Dim myName As String = "John"
    
    MessageBox.Show("Hello & myName")
    and then try running this code:
    Code:
    Dim myName As String = "John"
    
    MessageBox.Show("Hello " & myName)
    Compare the results and then take another look at your code.

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