[AccessD] Refer to a control on parent form from subform

David McAfee davidmcafee at gmail.com
Tue Apr 17 12:40:06 CDT 2012


You can always call it in this manner:
Forms!frmMainForm!!sbfrmName!txtSomeField

Or this way:

Me.Parent.txtSomeField = "SomeValue"
or
strSomeVariable = Me.Parent.txtSomeField

Me.sbfrmMySubForm.Form.txtIncDetID = 0
or
Me.sbfrmMySubForm.txtIncDetID = 0



I've used this in ADPs:

Me.sbfrmItemIncentive.Form.Recordset = "stpItemIncentive"

to requery:
Me.sbfrmSalesDetailByInvoiceNo.Form.Requery




On Tue, Apr 17, 2012 at 9:38 AM, Arthur Fuller <fuller.artful at gmail.com>wrote:

> Actually I need to do it both ways.
>
> On the subform I need to refer to the value of a control on the parent
> form.
> On the parent form I need to set the recordsource of the subform.
>
> I've forgotten the Access 2000 (SP3) syntax.
>
> 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