linking field from main form to sub form

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Stoic
    New Member
    • Jun 2012
    • 68

    #1

    linking field from main form to sub form

    Hi,
    I have an entry form with a field(combo box) called cboGetCode. I also have a sub form (continuous form) with number of fields, also an entry form. Now, I have added a code behind the cboGetCode AfterUpdate event to populate the result to relevant fields in the main form.

    Code:
    Me.lngSCode = DLookup("[lngSchoolCode]", "[qrReadingFirstSchools]", "[lngSchoolCode]='" & Me.cboGetCode & "'")
    This is working very well.


    Now, what I would like to do is get code as shown in the cboGetCode field to my sub form lngSCode field.

    Any help?
  • zmbd
    Recognized Expert Moderator Expert
    • Mar 2012
    • 5501

    #2
    These are a few of the articles here on Bytes.com dealing with form filtering and cascading combobox
    Form Filter and Cascasde
    From the Bytes > Sitemap > Microsoft Access / VBA Insights
    42.Cascaded Form Filtering
    156.Cascading Combo/List Boxes
    168.Example Filtering on a Form.


    [EDIT]
    Forgot to include #45!!! Getting old and forgetfull !
    How to select Records in an Access Subform from a Combo Box
    [/EDIT]

    For a begining/novice programmer these can be a heavy read; however, if you get stuck, simply don't "get it", and/or if none of these work for you, then please post back here and we'll try our best to walk you thru things.


    :)
    Last edited by zmbd; Aug 16 '13, 04:45 PM. Reason: [z{forgot to include #45 which is directly related to OP}]

    Comment

    Working...