Results 1 to 5 of 5

Thread: SQL using textbox variable

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 1999
    Location
    UK
    Posts
    300

    Post

    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

  2. #2
    Addicted Member
    Join Date
    Oct 1999
    Posts
    232

    Post

    If you have numeric field PalletNo you must use sql = "SELECT * FROM FQPack WHERE PalletNo = " & trim(txtdeletepallet)


    ------------------
    smalig
    [email protected]
    smalig.tripod.com

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 1999
    Location
    UK
    Posts
    300

    Post

    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 !

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 1999
    Location
    UK
    Posts
    300

    Post

    got it working :-)

  5. #5
    New Member
    Join Date
    Nov 1999
    Location
    millersport, Ohio USA
    Posts
    8

    Post

    Try:
    "SELECT * FROM (your table) WHERE (your field) = """ & textbox.text & """"

    Hope this helps.

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