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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subform Recordset 1

Status
Not open for further replies.

Azita79

Programmer
Jan 30, 2003
41
US
Hi All,

I am using Recordset to retrieve data from SQL server. After the rst is back I do

Set Me.Recordset = rst
and then populate the Detail section of my form.

but when I wana use this form inside another form as a subform I can't find a Recordset property for the subform

I was trying
Set Me.frmSubSearch.Recordset = rst

I get an error:"Method of Data member not found?

any help would be greatly appreciated.

Azita
 
Hello Azita,
I believe that you are missing the
Code:
Form
object. Try the following code:
Code:
Set Me.frmSubSearch.Form.Recordset = rst
Good Luck,
Robert Professional, affordable, Access database solutions and assistance
 
Unfortunately, when a Form becomes a subform it also becomes a control within the outer Form and Controls do not have the recordset property. As an alternative, pop up another form and pass the recordset to the new Form. You could make the recordset a public object in the standard module and then reference it in the Form you pop up. Hope that helps.
 
Hey guys,

Thanks for your help. I figured it out. the subform does have a Recordset property. Here is how you use it:

SET Forms!frmMain!frmSubSearch.Form.Recordset = rst


Azita
:)I
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top