[AccessD] Update the value of a control on parent form from subform

John W. Colby jwcolby at colbyconsulting.com
Fri Sep 9 20:27:32 CDT 2005


Controls are preceded by !, properties by .

Me.Parent - parent is a property pointing to my parent

Me.Parent!SomeControl


John W. Colby
www.ColbyConsulting.com 

Contribute your unused CPU cycles to a good cause:
http://folding.stanford.edu/

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Arthur Fuller
Sent: Friday, September 09, 2005 6:23 PM
To: 'Access Developers discussion and problem solving'
Subject: [AccessD] Update the value of a control on parent form from subform


Shamil recently assisted me with the syntax to refer to a control on a
subform, and now I need to do the opposite from within a "With Me" block. I
tried "Parent" as in the following sample line, with a couple of variations,
but I got it wrong. 
With Me
    .Parent.MyControl = 12345
    .Parent.Form.MyControl = 12345
    .Parent.Form.MyControl.Value = 12345
End With

And another thing about these "With Me" blocks. It appears from my
experiments that you cannot nest them. I.e. With Me
    .control1 = 124
    .control2 = "This is some text"
    With .mySubForm
        .control1 = True
        .control2 = "This is some more text"
    End With
End With

Whereas one can next Case blocks, While loops, If blocks, etc. Can anyone
think of a logical reason why With blocks do not conform to the general
rule? TIA, Arthur


-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com






More information about the AccessD mailing list