Re: Scope of Variant / Array

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hi -

Since in the immediate window you can reference the array without the parent.
qualifier i.e. ?ubound(m_setting) , your code should work without the parent.
qualifier as well. Try removing the parent. from the array reference.

John


KitCaz wrote:
Hi,

I've got a form with a linked subform. In the subform I have references to
variables declared 'public' in the parent form, e.g.:

public m_locked as boolean

I'm successful in referencing those variables in the subform by using a
'parent.' prefix, e.g.:

if parent.m_locked then...

Similarly, I have an array declared public to the parent which I populated
from a recordset prior, yet when I attempt to reference an element in it
(e.g. parent.m_setting(1,0) ), I get an error:

run-time error '451':

property let procedure not defined and property get proceduer did not return
an object

I'm able to get an accurate response when I type "?ubound(m_setting)" from
the Immediate Window while I'm debugging a line in the subform, so doesn't
that mean it's in scope? Yet I can't get a returned value on any element in
it.

Why can't I get the values out? What am I doing wrong?

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200709/1

.



Relevant Pages

  • RE: alter properties of subForm control (KBase Article 209099]
    ... "subform name in parent") and replaced the reference to parent form's name ... Private Sub Form_Current ... the main form and its subform. ...
    (microsoft.public.access.formscoding)
  • Re: Referencing returned array elements...
    ... Have a method to a 'word' object, parent() that returns an array of 'wrod' objects that are parents of the current object. ... Anyways, trying to reference the array elements when calling the function directly, but not sure it's possible. ...
    (comp.lang.php)
  • Re: Calling a subform from another form
    ... If the form containing the subform is not open, you can't reference the ... The parent *has* to be open. ... the form that the subform control is on, ...
    (microsoft.public.access.formscoding)
  • Re: [PHP] unset in foreach breaks recrusion
    ... Thanks for the answer, the none recursion function is a good idea, ... Basically you can make it work if you would sort the array from ... small to high by parent value, but in my case I will get this array ... Now, about your other suggestion, yes, it will work without the reference. ...
    (php.general)
  • Referencing returned array elements...
    ... Have a method to a 'word' object, parent() that returns an array of 'wrod' objects that are parents of the current object. ... Anyways, trying to reference the array elements when calling the function directly, but not sure it's possible. ...
    (comp.lang.php)