Results 1 to 6 of 6
  1. #1
    twildt is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2014
    Posts
    56

    Query over network takes forever - lets try a filter

    Right now I have a query that returns records based on input of a textbox of a form.



    I dragged this query onto the form so it is a subform view of the query. datasheet style.

    When the user enters the account number into the text box I have a control button that runs a "requery". The query is setup in the criteria section to use the account number entered on the form so it automatically returns the data they need to see. Works great. Returns multiple values if they exist.

    Problem is it's stored on the network. The query ALWAYS runs when you first open the form because it's dragged onto the form as a subform. Well there isn't any data inside the textbox yet because your just now opening the form! So the form takes a good 1-2 minutes to open that first time.

    I noticed when I take the criteria [form]![myform]![textbox] out of the query the form opens immediately with all the data shown in the subform. I could then just filter the data I need instead of using criteria in the query to ask for it from the textbox.

    Well my question is how can I use that textbox(after update event) to filter my subform automatically for the user?

    Or is there a way to fix my subform query to not run the query at form startup?

    Thanks in advance.

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    You could try deleting the Record Source of the form used in the subform control and setting it again in the After Update event of the text box. Code would be something like:
    Code:
    Me.[NameOfSubformCONTROL].Form.RecordSource = "NameOfQuery"
    Be aware though, that [NameOfSubformCONTROL] may not be the same as the name of the form as it is displayed in the database window.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    twildt is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2014
    Posts
    56
    That worked great!

    Thanks. Solved.

  4. #4
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Glad to help. How long does the form take to open now. Just curious.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  5. #5
    twildt is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2014
    Posts
    56
    It's instant. Even though it shows all the data, not having to run the query(with null value to lookup) made all the difference.

    Edit: Sorry, it doesn't show any data at startup. But it's still instant. Works perfect.

  6. #6
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    I assume that instant will be fast enough.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

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

Similar Threads

  1. front end changes take forever
    By survivo01 in forum Programming
    Replies: 4
    Last Post: 04-19-2013, 01:26 PM
  2. Replies: 2
    Last Post: 10-12-2012, 02:33 PM
  3. Replies: 1
    Last Post: 05-10-2011, 08:31 PM
  4. Access Takes my Query and Alters it!
    By dso808 in forum Queries
    Replies: 2
    Last Post: 10-01-2010, 03:45 PM
  5. Filter form on network ID
    By AZHorseTrader in forum Programming
    Replies: 3
    Last Post: 08-20-2010, 08:01 PM

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