PDA

Click to See Complete Forum and Search --> : SQL help please!


paul
Jul 8th, 1999, 05:18 PM
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


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

daffy
Jul 8th, 1999, 05:31 PM
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