SubForm 2 RecordSource

  • Thread starter Thread starter scott
  • Start date Start date
S

scott

I'm trying to set the RecordSource of a subform within or contained withn a
subform. In other words, I have [MainForm], [SubForm1] and [SubForm2].

My command button to fire the code is located on [SubForm1]. I'm getting an
"Invalid Reference to a form" error with my code below.

How should I change my below reference to change the SubForm2 RecordSource?


CODE *******************************

Me.subform2.Form.RecordSource = sSQL
 
Hi Scott,

To reference subforms from within other subforms, you are usually safest to
do use a full reference like this:

forms!MainForm.Subform2.form.recordsource = sSQL

Hope this helps.

Damian.
 
Back
Top