SubForm 2 RecordSource

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
 
G

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top