Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Referencing a Subform's recordsource

Status
Not open for further replies.

jamez05

Programmer
Jul 29, 2005
130
US
Hi,

I'm using Access 2003. I have a form (form1) that opens another form (form2) that contains a subform (form3).

The vba code on form1 needs to set the record source for form 3. I know Access is finding the form because I hide
some columns:
Code:
For I = 1 To 11
 Forms![form2]![form3]("Text" & I).ColumnHidden = True
Next I

However, when I try set the recordsource on form 3, I get the error "438 - object doesn't support this property or method". I've tried various ways of referencing it. Here's what I'm doing and I don't understand why it doesn't work:
Code:
Forms![form2].Form![form3].RecordSource = strSQL

Does anyone know what I'm doing wrong?
 
Got it:
Code:
Forms![form2]![form3].form.RecordSource = strSQL
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top