9- Sintaxis para Formulario & Sub
Autor: Kerin Hardwick
Para los ejemplos siguientes (3
subformularios anidados):
Mainform es el nombre del
formulario principal
Subform1 es el nombre del
CONTROL subformulario en el formulario
principal
Subform2 es el nombre del
CONTROL subformulario en SubForm1
Si estás en Formulario Principal | SubFormulario 1 | SubFormulario 2 | Ninguno de estos formularios | |
Propiedad del Formulario | ||||
De Mainform | Me.RecordSource | Me.Parent.RecordSource | Me.Parent.Parent.RecordSource | Forms!Mainform.RecordSource |
De Sub 1 | Me!Subform1.Form.RecordSource | Me.RecordSource | Me.Parent.RecordSource | Forms!Mainform!Subform1.Form.RecordSource |
De Sub 2 | Me!Subform1.Form!Subform2.Form.RecordSource | Me!Subform2.Form.RecordSource | Me.RecordSource | Forms!Mainform!Subform1.Form!Subform2.Form.RecordSource |
Control | ||||
De Mainform | Me!ControlName | Me.Parent!ControlName | Me.Parent.Parent!ControlName | Forms!Mainform!ControlName |
De Sub 1 | Me!Subform1.Form!ControlName | Me!ControlName | Me.Parent!ControlName | Forms!Mainform!Subform1.Form!ControlName |
De Sub 2 | Me!Subform1.Form!Subform2.Form!ControlName | Me!Subform2.Form!ControlName | Me!ControlName | Forms!Mainform!Subform1.Form!Subform2.Form!ControlName |
Propiedad de un Control | ||||
De Mainform | Me!ControlName.Enabled | Me.Parent!ControlName.Enabled | Me.Parent.Parent!ControlName.Enabled | Forms!Mainform!ControlName.Enabled |
De Sub 1 | Me!Subform1.Form!ControlName.Enabled | Me!ControlName.Enabled | Me.Parent!ControlName.Enabled | Forms!Mainform!Subform1.Form!ControlName.Enabled |
De Sub 2 | Me!Subform1.Form!Subform2.Form!ControlName.Enabled | Me!Subform2.Form!ControlName.Enabled | Me!ControlName.Enabled | Forms!Mainform!Subform1.Form!Subform2.Form!ControlName.Enabled |
Propiedad del Control Subformulario | ||||
De Mainform | N/A | N/A | N/A | N/A |
De Sub 1 | Me!Subform1.SourceObject | N/A | N/A | Forms!Mainform!Subform1.SourceObject |
De Sub 2 | Me!Subform1.Form!Subform2.SourceObject | Me!Subform2.SourceObject | N/A | Forms!Mainform!Subform1.Form!Subform2.SourceObject |
Si estás en Formulario Principal | SubFormulario 1 | SubFormulario 2 | Ninguno de estos formularios |