Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2006
    Posts
    108

    Unanswered: another query problem

    ive got another problem, i need to apply a query as i type in the criteria

    i have the query set to use like (a text box)

    and i need that when the user enters text say he enters U it will filter out any record not starting with U and then he type in N so now it filters out any record not starting with UN

    i tried using the onchange and onupdate procedures but when i enter the U it wont let me enter the N it just replaces the U with an N and messes up the filter.

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Not in Access ... WAY too cumbersome. Depending on your interface, just retrieve all records and apply your filter to the table/recordset/query and then requery ...
    Back to Access ... ADO is not the way to go for speed ...

  3. #3
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926

    Query

    If I read you correctly, you could do this:

    1. Create a text box on a form (no sourceobject) and call it: FXXX (or whatever).
    2. Design a query where the field you want criteria on has on the criteria row: Like Forms!MyForm!FXXX & *
    3. Make a Listbox on the form (i.e. called ListItems) where the rowsource = the name of this query with the criteria in 2 above.
    4. Using the OnChange event of the FXXX textbox, enter me.ListItems.requery (or you could also set the rowsource = "QueryName").

    Then everytime they enter a new character in the text box (FXXX), the listbox will requery showing the items that match what's in the text box. It's probably a slow way of doing it but it should work. If you have a lot of records in the underlying query, you may find it unbearably slow.

    Hope that's what you're looking for (if I read your question correctly.) There's a couple of other ways you could do this - this is what I thought of quickly.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •