Runtime 2455 Invalid reference to property form - Why doesn't thiswork?

  • Thread starter Thread starter tonyv
  • Start date Start date
T

tonyv

Ok this is driving me nuts. I am attempting to set the RowSource
Property of a control on the second subform On Open of the main form.
I keep getting the "2455 invalid reference to the property Form/
Report"

Here is my attempt in relation to being on the current main form
Me!PlacementsSubform.Form!MonitoringSubform.Form!Con_ID.RowSource =
"..."

Also I attempted to reference it explicitly
Forms!frm_Positions!PlacementsSubform.Form!MonitoringSubform.Form!
Con_ID.RowSource = "..."

I got my syntax from the Access Web - http://www.mvps.org/access/forms/frm0031.htm.
I am referencing the subform's CONTROL name and not their Source
Objects. The control Con_ID is the correct name and it is a combo box.

Your help is appreciated
Tony
 
Sorry, maybe this was the wrong forum or I wasn't clear. If you look
closely at my first example I am attempting to set a property of a
control on a form that is 2 subforms below the main form and I am on
using VBA. I am not setting the control source of a control to equal
the value of another control on a subform. Maybe it was presumptuous
to assume that would be understood by the example.

If you have additional suggestions feel free but I think I will post
in the FormsCoding group instead.

Thanks anyway,
Tony



Another Edit: The expression example assumed all objects on same form, no
subform. If subform involved would have to have the container name that holds
the subform. Modified example:
=IIf([Forms]![DataSoilsAgg]![tbxSet] Like "1*",IIf(nz([Forms]![DataSoilsAgg]!
[containername]!
[tbxLabOneHalf],100)=100,Null,IIf([SScond]="BA" Or [SScond]="CA",100-[Forms]!
[DataSoilsAgg]![containername]![tbxLabOneHalf])),Null)

Here is example of using the above structure in VBA code:
Pcalc = Format((Glo - ((Log(Dlo / Size) * (Glo - Ghi)) / Log(Dlo / Dhi))) *
(Nz([Forms]![DataSoilsAgg]![ctr1]![tbxLabNo10], 100) / 100), "0.0")

Just don't try the VBA structure in Access objects/controls.

I understand your frustration, took a lot of searching and paid consultant
and trial and error for me attain this understanding.
Edit to previous: Believe the structure you were trying is what you would use
to refer to a form's control in expressions used in Access query or formand
report controls (such as textbox) ControlSource. Example:
=IIf([Forms]![DataSoilsAgg]![tbxSet] Like "1*",IIf(nz([Forms]![DataSoilsAgg]!
[tbxLabOneHalf],100)=100,Null,IIf([SScond]="BA" Or [SScond]="CA",100-[Forms]!
[DataSoilsAgg]![tbxLabOneHalf])),Null)
I use this structure to refer to a subform from main form (works without the
Me.):
[quoted text clipped - 9 lines]
Your help is appreciated
Tony
 
Back
Top