Results 1 to 2 of 2
  1. #1
    RichardAnderson is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    74

    Changing RecordSource (Query) Of the Form Inside a SubForm

    Hello Guys....

    OK, here is the deal,



    I have a main form called frmMainProgram. It has 2 subforms called SubMain and SubDetails. The record source for SubMain is frmProduction_Schedule_Builds which has a record source of qryProduction_Schedule_Active. This query shows all active builds for the production line. On the main form frmMainProgram, I have a series of buttons that I want to change the record source (query) for frmProduction_Schedule_Builds that is INSIDE the subform SubMain. Another query is qryProduction_Schedule_Today or qryProduction_Schedule_BySalesOrder.

    Any help or tips would be great!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    So you want to change the subform to sort by different fields. Could use code that sets the Sort By property.

    Since the buttons and code are on main form, the code has to reference the subform properties through the subform container control. Would be easier to make the subform Continuous view and put the buttons in its form header section.
    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. Opening Form To a Record Inside a Target SubForm
    By RichardAnderson in forum Forms
    Replies: 5
    Last Post: 04-18-2014, 05:19 PM
  2. changing recordsource
    By slimjen in forum Forms
    Replies: 1
    Last Post: 05-02-2013, 06:08 AM
  3. Replies: 8
    Last Post: 03-16-2012, 11:04 AM
  4. Replies: 1
    Last Post: 08-03-2009, 08:24 AM
  5. Changing A Report Recordsource from a form
    By warrenjburns in forum Reports
    Replies: 0
    Last Post: 04-09-2009, 05:38 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