Setting LinkChildFields property

  • Thread starter Thread starter Russell
  • Start date Start date
R

Russell

I get the error 2455, 'You entered an expression that has
an invalid reference to the property LinkChildFields' for
the following case.

I am attempting in code to change the LinkChildFields
property of a chart embedded in a Report. I get this
error only when I attempt it in the Report_Open event and
not if I open the Report in design mode at runtime.
Further, if I step through the code after getting the
error at runtime, in the Form_Open event, it will not
error again. Trapping the error and rerunning the code
line does not work, it errors continuously.

This is the code snippet that fails:

Dim ctl as control
Set ctl = Me.<chart name>.Properties("LinkChildFields")
ctl.Properties(.Property) = <some string value>

Any ideas?
 
Russell said:
I get the error 2455, 'You entered an expression that has
an invalid reference to the property LinkChildFields' for
the following case.

I am attempting in code to change the LinkChildFields
property of a chart embedded in a Report. I get this
error only when I attempt it in the Report_Open event and
not if I open the Report in design mode at runtime.
Further, if I step through the code after getting the
error at runtime, in the Form_Open event, it will not
error again. Trapping the error and rerunning the code
line does not work, it errors continuously.

This is the code snippet that fails:

Dim ctl as control
Set ctl = Me.<chart name>.Properties("LinkChildFields")
ctl.Properties(.Property) = <some string value>

Any ideas?


Does a chart >have< a LinkChildFields property?

Even if it did, your code would certainly not access it properly. You can
not set a variable of type Control, to a property. And, a property does not
have a .Properties property! Ie. your code is all messed-up.

In a form, if sf is the name of a subform control, this line sets the
LinkChildFields property of that subform control:

me![sf].linkchildfields = "a; b; c"

Does that help?

TC
 
The .Property is part of a user defined data
type...sorry. But I have used code such as:

Me.[chartname].Properties!LinkChildFields = [some string
value]

And I get the same results, ie. it fails at runtime and
stepping through it at design time it does not fail!
The property does exist for Charts, SubForms, SubReports
and ObjectFrames, although MS Help only lists SubForms
and ObjectFrames as objects that the LinkChildFields
property applies to, clearly MS Help is incomplete. Even
if I convert the chart I am using to an ObjectFrame and
use the following I get the same error:

Me.[ObjectFrame].Properties!LinkChildFields = [some
string value]

So I am still stumped.

-----Original Message-----

Russell said:
I get the error 2455, 'You entered an expression that has
an invalid reference to the property LinkChildFields' for
the following case.

I am attempting in code to change the LinkChildFields
property of a chart embedded in a Report. I get this
error only when I attempt it in the Report_Open event and
not if I open the Report in design mode at runtime.
Further, if I step through the code after getting the
error at runtime, in the Form_Open event, it will not
error again. Trapping the error and rerunning the code
line does not work, it errors continuously.

This is the code snippet that fails:

Dim ctl as control
Set ctl = Me.<chart name>.Properties("LinkChildFields")
ctl.Properties(.Property) = <some string value>

Any ideas?


Does a chart >have< a LinkChildFields property?

Even if it did, your code would certainly not access it properly. You can
not set a variable of type Control, to a property. And, a property does not
have a .Properties property! Ie. your code is all messed- up.

In a form, if sf is the name of a subform control, this line sets the
LinkChildFields property of that subform control:

me![sf].linkchildfields = "a; b; c"

Does that help?

TC


.
 
I take it that "chartname" (without the quotes) is the name of the chart
control on your report?

Select that control in Design view, call up the property sheet, & see if
LinkChildFields is listed as a property. If it >is<, you should definitely
be able to access it as:

me![chartname].LinkChildFields
or:
report![chartname].LinkChildFields

Try it using that syntax >exactly<.

HTH,
TC


The .Property is part of a user defined data
type...sorry. But I have used code such as:

Me.[chartname].Properties!LinkChildFields = [some string
value]

And I get the same results, ie. it fails at runtime and
stepping through it at design time it does not fail!
The property does exist for Charts, SubForms, SubReports
and ObjectFrames, although MS Help only lists SubForms
and ObjectFrames as objects that the LinkChildFields
property applies to, clearly MS Help is incomplete. Even
if I convert the chart I am using to an ObjectFrame and
use the following I get the same error:

Me.[ObjectFrame].Properties!LinkChildFields = [some
string value]

So I am still stumped.

-----Original Message-----

Russell said:
I get the error 2455, 'You entered an expression that has
an invalid reference to the property LinkChildFields' for
the following case.

I am attempting in code to change the LinkChildFields
property of a chart embedded in a Report. I get this
error only when I attempt it in the Report_Open event and
not if I open the Report in design mode at runtime.
Further, if I step through the code after getting the
error at runtime, in the Form_Open event, it will not
error again. Trapping the error and rerunning the code
line does not work, it errors continuously.

This is the code snippet that fails:

Dim ctl as control
Set ctl = Me.<chart name>.Properties("LinkChildFields")
ctl.Properties(.Property) = <some string value>

Any ideas?


Does a chart >have< a LinkChildFields property?

Even if it did, your code would certainly not access it properly. You can
not set a variable of type Control, to a property. And, a property does not
have a .Properties property! Ie. your code is all messed- up.

In a form, if sf is the name of a subform control, this line sets the
LinkChildFields property of that subform control:

me![sf].linkchildfields = "a; b; c"

Does that help?

TC


.
 
Back
Top