Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8526909
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T08:24:22+00:00 2026-06-11T08:24:22+00:00

In Access 2007 (or 2010), I need to set the properties on a subform,

  • 0

In Access 2007 (or 2010), I need to set the properties on a subform, embedded within the first subform, from the main form using VBA. To make it clear which form I’m talking about, I’ll call the this form “subSubform” as I do in my code (well, subSubform is actually the name of the sub-subform control).

When the form loads I have a subform control on my first subform that’s blank (does not contain a form source object). If needed, I fill out the SourceObject property of this control with the name of a valid form, as well as the LinkMasterFields and LinkChildFields properties. This all appears to work fine because I do get an expandable plus sign that otherwise wouldn’t be there.

Next I try to set the RecordSource for the subSubform and I get an error:

2455 You entered an expression that has an invalid reference to the property Form/Report.

Here’s the code I’m using:

Me!subform1.Form!subSubform.Form.RecordSource = sSubformSQL
'and I've tried this with the same bad results
Me.subform1.Form.subSubform.Form.RecordSource = sSubformSQL
'and this too
Forms("frmQuery").subform1.Form.subSubform!Form.RecordSource = sSubformSQL

'And I've tried this. It fails too, on the last line with the same error:
    Dim frm As Form
    Set frm = Forms("frmQuery").subform1.Form
    Dim frm2 As Form
    Set frm2 = frm.subSubform.Form

I’ve tried setting a timer and waiting one second to run the above code, just in case it takes some time for the form to load. But this makes no difference.

I’ve tried running code from the first subform instead of from the main form, but that doesn’t help either. Still fails with the same error.

FWIW, both my subform and my subSubform are DataSheet views. I don’t think that makes any different on what I’m trying to do here (although I’m well aware of the performance problems involved so don’t scream at me).

I recognize that it’s probably a very odd request. But I’m creating a dynamic query interface that needs this.

Any ideas how to set form properties on a subSubform?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T08:24:23+00:00Added an answer on June 11, 2026 at 8:24 am

    The problem is not that you setting properites of a sub form. The format of:

    me.subform1.form.subform2.form.RecordSource = sql

    s+Should work just fine.

    The problem is you are trying to nest a continues form (or datasheet) in side of a continues for (or a datasheet). This is NOT permitted.

    The workaround is to simply place the two sub forms side by side and don’t’ nest.

    You can still get the second (child child) form to follow by using the link master settings.

    In the link child/master settings for child 1, you place:

    linkChildFields main_id (whatever is the name of the field in
    this sub-form that is used to relate back to the parent table)
    LinkMasterFields [ID]

    In the link child/master settings for child 2 form you place

    linkChildFields main_id (whatever is the name of the field in
    this sub-form that is used to relate back to the parent table)
    LinkMasterFields [child1].[form].[ID] (“masterForm” is the name of
    the control you used to hold the master form.

    So you can model a many to many, but you cannot nest, but as noted the above gives you the same result anyway. So a form will look like this one:

    enter image description here

    You also likly in the on-current event of the left side (child 1), will want to place a requery of the right side when you navagate – as it often will not update automatic for you.

    So:

    me.parent.Child2.Requery
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new creating applications using Visual Studio 2010 and Microsoft Access 2007. I already
I am new in creating application using Visual Studio 2010 and Microsoft Access 2007.
Are there many differences between Access VBA 2010 and 2007?
I'm using this connection string to access excel(2007,2010) files oleConnection.ConnectionString = @Provider=Microsoft.ACE.OLEDB.12.0;Data Source= +
Access 2007: We need a query to link two tables without using a unique
I've created an Access 2007 form that displays, for example, Products from a Product
I am connecting to a MS-Access 2007 database using VB 2010 and OLEDB. Conducting
I've been creating an application using Visual Studio 2010 C# and Microsoft Access 2007.
Just a little background: I am using Access 2010 to create forms and VBA
In Microsoft Access 2007 under (Form View), how do you make text in a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.