Works fine with Northwind.
Create a new form.
In design view, drag and drop existing form Categories on it.
On the main form you are creating, add a button, command1, and add the
onClick event subroutine handler:
------------------------------------------
Private Sub Command1_Click()
Debug.Print Me!Categories.Form![Product List].Form!ProductName.Name
End Sub
---------------------------------------------
Save the form. Open it, click on the button Command1. Observe, in the
immediate debug window, the desired result.
If it does not work in you case, you are probably not in the main form, or
use the object source name rather than the subform control name, or use
illegal name not enclosed with [ ], or something else, but the syntax is the
right one, as it can be observed with the preceding example.
Vanderghast, Access MVP
"jpang" <(E-Mail Removed)> wrote in message
news:EDFE1C2A-B8E2-47B5-91FF-(E-Mail Removed)...
> noop, doesn't work.
>
> Basically,
>
> Me!Subform1.Form!Subform2.Form!ControlName
>
> is not recognized as an object from the main form.
>
>
> "Michel Walsh" wrote:
>
>> You can take a look at http://www.mvps.org/access/forms/frm0031.htm
>>
>>
>> You were close, try something like:
>>
>>
>> Me!Subform1.Form!Subform2.Form!ControlName.Enabled
>>
>>
>> Vanderghast, Access MVP
>>
>>
>> "jpang" <(E-Mail Removed)> wrote in message
>> news:1E1EB420-BEA6-4098-BA42-(E-Mail Removed)...
>> > Thanks Dave for the info. What happen if I want to do the following:
>> >
>> > Me!Subformname.Sub-Subformname.Form.Propertyname?
>> >
>> > It seems that Access cannot recognize a 2nd level subform nested in the
>> > 1st
>> > level subform as an object. I cannot access the properties and
>> > controls
>> > of
>> > the 2nd level subform.
>> >
>> > Thanks for any help.
>> >
>> > "DaveT" wrote:
>> >
>> >> Me!Subformname.Form.Propertyname
>> >>
>> >> From example app:
>> >>
>> >> Debug.Print Me!TestTypeSUB.Form.RecordSource
>> >>
>> >> prints qryTestTypeSUB (the recordsource for the subform)
>> >>
>> >> Also see:
>> >>
>> >> ACC: How to Refer to a Control on a Subform or Subreport
>> >> http://support.microsoft.com/kb/113352
>> >>
>> >> --
>> >> DaveT
>> >>
>> >>
>> >>
>> >> "jpang" wrote:
>> >>
>> >> > Hello,
>> >> >
>> >> > I'm using Access 2003 and I need to revise properties (e.g.
>> >> > RecordSource) of
>> >> > a sub-sub form from a button on the parent form via code. When I
>> >> > tried
>> >> > to
>> >> > write the code, I could only see the 1st level sub form but not the
>> >> > 2nd
>> >> > level
>> >> > subform as an available object of the parent form. I tried to write
>> >> > a
>> >> > module
>> >> > outside of the parent form to manipulate the properties of the 2nd
>> >> > level
>> >> > subform and then call that module from the parent form. Although
>> >> > the
>> >> > code
>> >> > excuted successfully, the properties of the nested subform were not
>> >> > revised.
>> >> >
>> >> > Any help will be appreciated.
>>
>>
>>