PDA

Click to See Complete Forum and Search --> : SQL using textbox variable


locutus
Oct 26th, 1999, 05:54 PM
can anyone see what is wrong with this line as I can't get
it to work !

sql = "SELECT * FROM FQPack WHERE PalletNo = ' " & trim(txtdeletepallet) & " ' "

when I do this it works fine
sql = "SELECT * FROM FQPack WHERE PalletNo = '559294017' "

I have set up a text box (txtdeletepallet) to allow only
numeric entry and I want this to be my search criteria
against the palletno in FQPack rs.

> thanks for looking

smalig
Oct 26th, 1999, 08:07 PM
If you have numeric field PalletNo you must use sql = "SELECT * FROM FQPack WHERE PalletNo = " & trim(txtdeletepallet)


------------------
smalig
smalig@hotmail.com
smalig.tripod.com (http://smalig.tripod.com)

locutus
Oct 26th, 1999, 08:54 PM
The palletno field in the table is a text field, I used the examples shown in my books for using a variable in an sql string but can't get it to work
Anyone !

locutus
Oct 26th, 1999, 09:07 PM
got it working :-)

stweelman
Nov 13th, 1999, 03:53 AM
Try:
"SELECT * FROM (your table) WHERE (your field) = """ & textbox.text & """"

Hope this helps.