Refering to a detail section on a form

G

Guest

I inherited someone's form where the form has to Fnames. One on the main and
one in the subform. How do I refer to the other fname?
Its not detail.fname

I can say me.fname and get the field on the main form, but I don;t know how to
refer to the other thing. I hate when people use all that autocrap that makes
the forms and table fields have the exact same names.

In fact I still don;t know how to refer to a forms field in the rowsource if it
has the same name as the table. I can't say me.fname in a controlsource
[email protected]
 
M

MGFoster

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

From the main form referring to a control in the subform

(VBA):
Me!SubFormControlName!ControlName

(Control Source property):
=Form!SubFormControlName!ControlName

From the subform referring to a control in the main form (VBA):

(VBA):
Me.Parent!ControlName

(Control Source property):
=Form.Parent!ControlName

Substitute your subform control name and control name where appropriate.

When Form is used in a ControlSource it refers to the form the control
is on. Parent refers to the main form the subform is on.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQIiJAoechKqOuFEgEQISYwCdE7nkgm/AlmRDZyRhmz1VBXh+oqMAnjxC
X67Ne4lztU5kg8ihfK/ngAb6
=dtBL
-----END PGP SIGNATURE-----
 
V

Van T. Dinh

Forms!MainForm!SubformControl.Form.fname

Replace MainForm and Subform*Control* with the names from your set-up. Note
that the name of the Subform*Control* may be different from the name of the
Form you used as the Subform.
 
Top