Results 1 to 2 of 2

Thread: SQL help please!

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 1999
    Posts
    118

    Post

    Hi
    I have a msaccess database that has 2 tables in it .One with customer
    information and one with order information. I have a order entry form that
    has text boxes for user input .What I want is the user to enter a telephone
    number and press enter then have a SQL statment
    to search for this phone number if it has a match then display the
    results.Can anyone give me an example of the statment I would need to use?
    thanks
    Paul


    ------------------

  2. #2
    New Member
    Join Date
    Jun 1999
    Posts
    7

    Post

    For a table with fields Name, Address, Sex, Tel. No and we only want Name and Address we could use ..

    strSQL as String

    "SELECT Name, Address, TelNo " & _
    "FROM MyUserTable WHERE " & _
    "TelNo = '"+txtPhoneNo.Text+"'"

    Should do the trick.

    You may need to use format(txtPhoneNo.Text) depending on how the value is stored in your database, int vs string.

    Daffy

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