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

Posted on 2011-05-11
Medium Priority
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
  • 2
  • 2
LVL 120

Accepted Solution

Rey Obrero (Capricorn1) earned 1000 total points
ID: 35739192
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

dqmq earned 1000 total points
ID: 35739263
Forms![frm_excel2]![SUBFORM1]!form![frmQuote]![SUBFORM2].Form[frm_Quote_Tracking].RecordSource= "select ...."

Author Closing Comment

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

Im usually and expression builder wizard..

Thx Guys!
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 35739628

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

Expert Comment

ID: 35740167
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.


Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
Windows Explorer lets you open cabinet (cab) files like any other folder. In VBA you can easily handle normal files and folders, but opening and indeed creating cabinet files takes a lot more - and that's you'll find here.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Suggested Courses

839 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