Results 1 to 5 of 5

Thread: Table Lookup

  1. #1
    Join Date
    Oct 2004
    Posts
    57

    Unanswered: Table Lookup

    I am trying to build a form that will lookup and display a record from a table based on one of the fields in the table. I tried messing around with dlookup and goto functions, but it doesn't seem to work.
    For example: I want the user to type in the persons last name and it will display the record with that last name within the form....Any ideas...thanks to all.

  2. #2
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    assuming this code is running in a form which has an unbound textbox in the header called thisName and you plan to display in the detail section

    and the table is myTable with a field myName,


    Me.recordsource = "SELECT * FROM myTable WHERE myName = '" & Me.thisName & "';"
    Me.requery


    izy
    currently using SS 2008R2

  3. #3
    Join Date
    Oct 2004
    Posts
    57
    golden!!!
    if it were any more beautiful, i'd buy it a drink.
    thanks for the help.

  4. #4
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004
    Quote Originally Posted by Geremia
    golden!!!
    if it were any more beautiful, i'd buy it a drink.
    thanks for the help.

    And also Welcome to the Forum
    Bud

  5. #5
    Join Date
    Oct 2004
    Posts
    57
    thanks for the hospitality....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •