Results 1 to 2 of 2
  1. #1
    sergiomb is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Mar 2016
    Posts
    1

    Select Source Object subform

    Hello,



    I have a form called SEARCH_MATERIAL_FORM, which contains a subform called Mechanics. I need the subform Source Object to change when I select a value in a combobox called MasterGroupList. The source object should be a query called MaterialsMasterGroup

    Right now I have this:


    Private Sub MasterGroupList_AfterUpdate()


    Me!Mechanics.SourceObject = "MaterialsMasterGroup"


    End Sub

    But I get this error:

    Run-time error '2101':

    The setting you entered isn't valid for this property

    Someone knows what am I doing wrong?

    Thanks

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    The comb box will have 2 fields,the caption for users, and the subForm name.
    make sure the combo columns property is 2, and bound to col 2.
    user picks an item, then set the source.
    Code:
    sub cboBox_Afterupdate
      subFrm.controlsource = cboBox
    end sub

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

Similar Threads

  1. chaging a subreport's source object at runtime
    By markjkubicki in forum Reports
    Replies: 4
    Last Post: 12-15-2015, 11:16 AM
  2. Replies: 6
    Last Post: 08-21-2015, 10:07 AM
  3. Replies: 4
    Last Post: 08-09-2015, 10:03 AM
  4. Replies: 6
    Last Post: 05-05-2012, 08:43 AM
  5. Replies: 2
    Last Post: 10-18-2010, 07:53 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