form nesting in vb

  • Thread starter Thread starter cognisant_me
  • Start date Start date
C

cognisant_me

Hi,



I ecountered this piece of code in vb. Could anyone explain how this
is happening

Set RSFrm = Me.Form("TPO RS2").Form where RSFrm is a form object. How
come such nesting of forms is posible



Also in

RSFrm ! [X Y] = RSFrm ! [A B]



what is the significance of the ! sign and how come x Y is valid with a
space in between (what does it signify).........



please do help, this is veru urgent for me
 
cognisant_me said:
I ecountered this piece of code in vb. Could anyone explain how this
is happening

Set RSFrm = Me.Form("TPO RS2").Form where RSFrm is a form object. How
come such nesting of forms is posible

Also in

RSFrm ! [X Y] = RSFrm ! [A B]

what is the significance of the ! sign and how come x Y is valid with a
space in between (what does it signify).........

If you really meant you're working in vb, then I have no
idea.

If you're working in Access VBA with Access forms, then the
reference: Me.Form("TPO RS2").Form
is referring to the form object being displayed in the
subform control named TPO RS2. Note that the first use of
..Form is completely redundant and is never(?) used in
practice. Most programmers would use any one of these
equivalent references instead:
Me("TPO RS2").Form
or
Me.[TPO RS2].Form
or
Me![TPO RS2].Form
or, if you want to be explicit about everything
Me.Controls![TPO RS2].Form
or
Me.Controls("TPO RS2").Form
or
Me.Properties![TPO RS2].Form
or
Me.Properties("TPO RS2").Form

Bang (!) is used to reference a member of a collection.
Dot (.) is used to reference an object's properties and
methods. Note that controls on a form are members of both
the form's Controls collection and its Properties
collection, so either . or ! can be used.

Although most people consider it to be poor programming
style, you can use spaces and other funny characters in
names as long as the names are enclosed in square brackets.
So [X Y] just refers to the control named X Y and as I said
earlier the ! is needed to refer to the [X Y] control in the
form's Controls collection. This practice is strongly
discouraged.
 
Back
Top