Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Recordset "LIKE" filter of a number column

Recordset "LIKE" filter of a number column

Scheduled Pinned Locked Moved Database
helpquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Menny Even Danan
    wrote on last edited by
    #1

    I've posted a message here yesterday, but it seems that i was mis-understood. I'm using vb6 ADO's Recordset. i want to use the recordset's Filter property. but the target column is numeric (the ID column of the table, int). i want to filter the table, so i'll stay with the rows that begins with a certain number, just as a varchar column i'll use "LIKE" filter. when trying to do it, i get an error "Filter can not be opened." any ideas? thanks

    J 1 Reply Last reply
    0
    • M Menny Even Danan

      I've posted a message here yesterday, but it seems that i was mis-understood. I'm using vb6 ADO's Recordset. i want to use the recordset's Filter property. but the target column is numeric (the ID column of the table, int). i want to filter the table, so i'll stay with the rows that begins with a certain number, just as a varchar column i'll use "LIKE" filter. when trying to do it, i get an error "Filter can not be opened." any ideas? thanks

      J Offline
      J Offline
      jlawren7
      wrote on last edited by
      #2

      you could put a textbox on your form, and in the code, use the textboxes text property in your filter. create a varible and set the val(textbox) = to your varible and search that way ex. dim SQLSearch as integer sqlSearch = Val(Text1.Text) "SELECT Whatever FROM Wherever WHERE Field LIKE '%" & SqlSearch & "%'" the more you type in the textbox, the closer your search will be please note the use of the % in the SQL Query you could even put your search into the textboxes textchange () if your using ado ex. ado.recordsource = "SELECT Whatever FROM Wherever WHERE Field LIKE '%" & SqlSearch & "%'" ado.refresh so as you type, the the search gets smaller Hope this helps Help is great only if you ask correctly :)

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups