Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Search table fields via textboxes

Search table fields via textboxes

Scheduled Pinned Locked Moved Visual Basic
databasealgorithmsquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Dave McCool
    wrote on last edited by
    #1

    I have a form with two textboxes. One is txtForname and other is txtSurname and I also have a search button btnSearch. I have a table from a MSAccess database below this. The table has the fields "Forname" and "Surname" and what i would like is to, when you type something in either "Forename" or "Surname" the results automatically display in table when button search is clicked like a query when searching a field in a table. How would I do this?

    In the end we're all just the same

    D V 2 Replies Last reply
    0
    • D Dave McCool

      I have a form with two textboxes. One is txtForname and other is txtSurname and I also have a search button btnSearch. I have a table from a MSAccess database below this. The table has the fields "Forname" and "Surname" and what i would like is to, when you type something in either "Forename" or "Surname" the results automatically display in table when button search is clicked like a query when searching a field in a table. How would I do this?

      In the end we're all just the same

      D Offline
      D Offline
      David Mujica
      wrote on last edited by
      #2

      Here is an approach I have used: 1) Create an unbound form with 2 text boxes txtForname, txtSurname and your search button, btnSearch. 2) Place a subform on your form which includes your datatable; Employees (or whatever) 3) Put code behind the btnSearch on the Click event that sets a filter for your subform. Example: me.employee_subform.Form.Filter = me.txtForname.value me.employee_subform.Form.FilterOn = true this should get you a head start; you will need to consider blanking out fields and determining which field to filter on.

      1 Reply Last reply
      0
      • D Dave McCool

        I have a form with two textboxes. One is txtForname and other is txtSurname and I also have a search button btnSearch. I have a table from a MSAccess database below this. The table has the fields "Forname" and "Surname" and what i would like is to, when you type something in either "Forename" or "Surname" the results automatically display in table when button search is clicked like a query when searching a field in a table. How would I do this?

        In the end we're all just the same

        V Offline
        V Offline
        Vimalsoft Pty Ltd
        wrote on last edited by
        #3

        Here i search the table and display data in the Grid http://www.codeproject.com/KB/cs/N-Tier22.aspx[^] Is this Similar to what you want ?

        Vuyiswa Maseko, Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding VB.NET/SQL7/2000/2005 http://vuyiswamb.007ihost.com http://Ecadre.007ihost.com vuyiswam@tshwane.gov.za

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups