Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2011
    Posts
    2

    Subforms and Query Parameter

    I'm using Access 2007 and attempting to build a series of forms. As most of them will the same set of search criteria, I would like consolidate them to 1 form and use it as a sub form.



    For example,
    I have two forms frmParameters that contains combo-boxes, list boxes etc. One of the main forms, frmCapitalLaborReport, would have its own parameters and include frmParameters as a subform.

    frmParameters uses a query qryGetCalendarPeriods to populate a listbox based on a change in the combo-box. frmParameters is completely independent of any other form.

    When I test just frmParameters, both combo-box and list-box are populated. When I embed frmParameters in frmCapitalLaborReport, the query is unable to locate the combo box for its parameter.




    Would appreciate your opinions/ideas

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    I don't have 2007 on this machine, but it sounds like you need to adjust the form reference due to the form becoming a subform:

    Forms Refer to Form and Subform properties and controls
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Join Date
    Jan 2011
    Posts
    2
    I purposefully didn't want to refer to frmParameters as a subform in my query as I hope to reuse it in multiple forms (similar to frmCapitalLaborReport).

    I worked it out by removing the reference to the form name from my query and using QueryDefs to load the listbox. The Query has a parameter and I pass the ID of the selected Combo box item in the Change Event Handler. I'll update my sample and post shortly.

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

Similar Threads

  1. How to run parameter query from VBA
    By John Southern in forum Programming
    Replies: 10
    Last Post: 02-07-2014, 02:24 PM
  2. Parameter Query with Combobox?
    By Krs13 in forum Forms
    Replies: 3
    Last Post: 12-21-2010, 06:15 AM
  3. Parameter query
    By doss13 in forum Queries
    Replies: 1
    Last Post: 06-26-2010, 06:11 AM
  4. Parameter Query help...
    By daggy in forum Queries
    Replies: 1
    Last Post: 05-11-2010, 01:10 AM
  5. Parameter in Crosstab Query
    By RandyG in forum Queries
    Replies: 4
    Last Post: 09-30-2009, 06:40 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