Results 1 to 4 of 4
  1. #1
    gangel is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2014
    Posts
    194

    LONG time to wait for 4xcriteria query to run (5 seconds)

    Hey everyone!

    SO I have created a query that shows a bunch of prescriptions at my pharmacy that are requiring payment still, and i have filter text boxes above the query (in parent) which filters my query results.

    TABLE:
    ID - cust Name - Medication - Company - Payment ID

    Query:
    As above but PaymentID is NULL

    cust field:
    criteria "Like * & parent!txtcustomer & *"

    etc etc for ID, med and company (and 2 others) but you get the point

    Because the company or med might be NULL on the actual field i have things like



    ID: "Like * & parent!TxtID & *"
    Cust (as above)
    Employer is null
    Medication like * parent!txtmed

    Then next line is

    ID: "Like * & parent!TxtID & *"
    Cust (as above)
    Employer like * parent!txtEmp
    Medication is null


    So i have 4 criteria lines with criteria for about 5 fields based on text boxes...



    Ill post a photo too as i KNOW this is confusing.

    Anyway, how can i simplify this beacuse I really think i'm doing this wrong!!!

    What i need is to see all records if no filters are on, then see records based on whichever filters are being used, with the understand there ISNT always data in that field in every record!!!
    Click image for larger version. 

Name:	Image 023.jpg 
Views:	11 
Size:	126.1 KB 
ID:	21849
    Click image for larger version. 

Name:	Image 022.jpg 
Views:	11 
Size:	173.5 KB 
ID:	21850

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    I NEVER use dynamic parameterized queries. I prefer http://www.allenbrowne.com/ser-62.html
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Perceptus's Avatar
    Perceptus is offline Expert
    Windows 7 64bit Access 2007
    Join Date
    Nov 2012
    Location
    Knoxville, Tennessee
    Posts
    659
    you could simplify by using a make table query based on the underlying query. And then filter the newly created table with a 2nd query.

    or you could simplify with making subqueries and what not. If it makes sense to you and you can explain it to the next guy, thats good enough for me =).

  4. #4
    gangel is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2014
    Posts
    194
    thanks ppl

    June7 that was above my brain level last time you mentioned it but i think ill have a look now and get it working that way.

    Percept, ill use the subquery method as a fall back. If i can master the sql a bit better and learn from this code then all the better

    Thanks pplz!~

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 03-19-2015, 08:43 AM
  2. Replies: 2
    Last Post: 08-21-2014, 08:36 AM
  3. Count query takes too long time
    By shabar in forum Queries
    Replies: 4
    Last Post: 01-28-2013, 09:00 PM
  4. Replies: 10
    Last Post: 04-17-2012, 10:29 AM
  5. ODBC and Long Query Time
    By pdouglas in forum Access
    Replies: 0
    Last Post: 07-09-2009, 10:21 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums