Working with subforms

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Petrol
    Contributor
    • Oct 2016
    • 292

    Working with subforms

    I have a form bound to my People table to display data about a selected person. If the person is a musician (indicated by a flag in the People record) there may be one or more entries in a second table, Musos, each entry containing the PersonID and the instrument they play. If they play several instruments, they may have several entries in Musos.

    On the main form there is a subform bound to the Musos table and linked on PersonID. The subform should show, in continuous forms view, a list of the instrument(s) they play. The record is updatable - I want to have a combo box on the subform allowing the user to select an instrument from a third table, Skills. But I can't figure out how to get it working. The row source is currently set to
    Code:
    SELECT [Skills].[SkillID], [Skills].[Skill] FROM Skills ORDER BY [Skill];
    . Can anyone help?
  • twinnyfo
    Recognized Expert Moderator Specialist
    • Nov 2011
    • 3662

    #2
    The Combo Box should be bound to the Skills Field in the Musos Table. Every time you select an instrument on a new record, it will associate that new record with the current person filter in the subform.

    Hope this hepps!

    Comment

    • Petrol
      Contributor
      • Oct 2016
      • 292

      #3
      Ah, thank you. I was binding the wrong field, for some reason.
      This now works for adding an instrument or changing to another instrument. When I delete an instrument it leaves the Musos record there with an empty SkillID field and hence an empty slot in the subform list, but I guess I can write code to delete the record.

      Comment

      • twinnyfo
        Recognized Expert Moderator Specialist
        • Nov 2011
        • 3662

        #4
        Glad I could hepp! Let us know if you need anything else.

        Comment

        Working...