Referencing a subform inside of a subform -- w/VBA

Posted on 2011-05-11
Last Modified: 2012-05-11
I was running into a problem referencing a subform of a subform in Access..
I want to change the recordsource but to get the syntax correct I am just trying to change the visible property..

I have a Main form | Quote Sub form | Quote Tracking Sub Form
Access has a problem with these syntaxs

Forms![frm_excel2]![frm_Quote]![frm_Quote_Tracking].Form.Visible = False
Forms![frm_excel2]![frm_Quote].Form![frm_Quote_Tracking].Form.Visible = False

Any help is appreciated
Question by:joein610
    LVL 119

    Accepted Solution

    see this link as a reference

    Mainform is the name of the top level form

    Subform1 is the name of the subform CONTROL on mainform

    Subform2 is the name of the subform CONTROL on the 1st subform.

    in your case, make sure you are using the name of the subform CONTROL
    LVL 42

    Assisted Solution

    Forms![frm_excel2]![SUBFORM1]!form![frmQuote]![SUBFORM2].Form[frm_Quote_Tracking].RecordSource= "select ...."

    Author Closing Comment

    By amateurish self was also screwing up by using the SourceObject instead of the Name..

    Im usually and expression builder wizard..

    Thx Guys!
    LVL 119

    Expert Comment

    by:Rey Obrero

    it is okay to split points among comments, only if those comments are correct.
    LVL 42

    Expert Comment

    I agree that all too often points are awarded indescriminantly, either split unfairly or not split when they should be.  I gladly offer to refund my points for the poor answer.  That said, sometimes even a wrong answer contributes to the solution and it is hard to second guess the rationale behind award of points.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Suggested Solutions

    Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
    In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
    Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
    Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now