Results 1 to 4 of 4
  1. #1
    Bcanfield83 is offline Advanced Beginner
    Windows 7 32bit Access 2016
    Join Date
    May 2018
    Posts
    81

    Question Query performance when referencing form controls

    I have a couple of queries that use parameter values taken from controls (combo boxes) on a form, e.g.: there's a couple fields that have the below listed as the criteria:

    [Forms]![frmMenu_Reports_Main].[SubformContainer]![cboRole1]
    [Forms]![frmMenu_Reports_Main].[SubformContainer]![cboRole2]



    The queries take a good 20-25 seconds before the output is produced.. Yet, if I run the queries after tweaking them to include in a specific value in those 2 fields (versus pulling values from the combo boxes on the form/subform), they take all of 1 second. So clearly it is the form parameters slowing it down.
    The tables used in the queries are linked via an ODBC Connection (to an Oracle DB). So I thought of using a Pass-Through Query instead, though I don't think there's a way to pass a value from the form into a Pass-Through Query, correct? Would it need to be done through VBA?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    are you sure this is the correct object path? (use the BUILDER)
    it should be:
    [Forms]![frmMenu_Reports_Main].[SubformContainer].form![cboRole1]

    And why query objects in the subform?
    put the query in the subform and the param is: me.cboRole1

  3. #3
    Bcanfield83 is offline Advanced Beginner
    Windows 7 32bit Access 2016
    Join Date
    May 2018
    Posts
    81
    You're right, when using the builder, the references were updated to: [Forms]![frmMenu_Reports_Main]![SubformContainer].[Form]![cboRole1]
    Though it also worked when entering "[Forms]![frmMenu_Reports_Main].[SubformContainer]![cboRole1]".
    To improve the performance, I created an initial pass-through query which creates a temp table. In the temp table, I indexed the fields being used as parameters in the query.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,900
    Can't use Me. in query or in Access objects/controls/properties, only in VBA.
    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.

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

Similar Threads

  1. Replies: 9
    Last Post: 01-13-2015, 07:30 AM
  2. Referencing Controls on and off a Tab
    By dccjr in forum Programming
    Replies: 2
    Last Post: 04-25-2013, 05:43 AM
  3. Replies: 8
    Last Post: 02-04-2013, 11:32 AM
  4. Referencing subform controls
    By cheyanne in forum Forms
    Replies: 7
    Last Post: 04-30-2012, 10:00 AM
  5. Referencing Controls on Forms
    By cbh35711 in forum Access
    Replies: 7
    Last Post: 04-05-2012, 09:04 PM

Tags for this Thread

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