I have a subform "TimeSheet" which is a child of the parent form. How do I reference using VBA the objects on the subform?
I have a subform "TimeSheet" which is a child of the parent form. How do I reference using VBA the objects on the subform?
if the parent needs to see things in the child, it would be me.child72!txtBox4 (use the BUILDER , it will get the path correct, you just pick)
but in the child sub form, all child objects are local, msgBox txtbox4
What are you trying to do?
Your VBA would be:
The former is for referring to a subforms control if you are writing the code within the main forms module. The latter is form referring to a control on the subform from another module.Code:Me.SubFormName.Form.[ControlName] Forms![MainFormName].[SubFormName].Form.[ControlName]
The '.Form' is supposed to be there as such, subforms have a .Form property that links them to the parent form.
More info on subforms: http://bytes.com/topic/access/insigh...items-sub-form
Last edited by nick404; 08-27-2015 at 07:32 AM. Reason: added information link