The path to the subform is
Me.ctlNameOfSubformControl.Form.PropertyOrControl
The Subform Control is a control on the main form that holds the subform. To
get the name of this control (it may or may not be the same as the subform,
depending on how you added the subform to the main form), open the main form
in design mode, open the Properties sheet, and click on the subform ONE
time. The Properties sheet should show the name of the subform control. If
you click more than once, you'll be in the subform and the Properties sheet
will show the name of the subform or its components, not the name of the
control holding the subform.
--
Wayne Morgan
MS Access MVP
"Bill Agee" <ws**@mindspring.com> wrote in message
news:cx*****************@newsread3.news.atl.earthl ink.net...
I have a subform called PaymentDetails and would like to dynamically assign
the recordsource after the form/subform is opened.
The recordsource for Payment Details is "PaymentDetails_qry" which uses
a function to filter the Invoice #. The invoiceID is not known until
after
the
form is opened. After the InvoiceID is selected from a dropdown I then
want to assign the recordsource
Me!Form!PaymentDetails.Recordsource="PaymentDetail s_qry"
but this is giving me an error.
Any suggestions?