lehnen
Jan 28 2005, 11:33 AM
Dim db As DAO.Database
Dim rs As DAO.Recordset
'Set rs = Me![report_tab].[Invoices_tbl_subform].Form.RecordSource ' Ive tried thhis line w/o the [report_tab] does not work...same for line below...
Set rs = db.OpenRecordset(Me![report_tab].[Invoices_tbl_subform].RecordSource, dbOpenDynaset)
With rs
Do Until .EOF
Me![Invoices_tbl_subform].Form.fTriggerInvoiceBtn ' this a public function that calls a button on the subform
.MoveNext
Loop
End With
JeffK
Jan 28 2005, 12:31 PM
The form's Recordsource is a string, not a reference to its Recordset. If you want to get the form's Recordset, use its Recordset property. Also, you don't have to to refer to controls on tabs any differently than other controls. They are still properties of the form itself:
This line:
Set rs = Me![report_tab].[Invoices_tbl_subform].Form.RecordSource
Shoud be:
Set rs = Me![Invoices_tbl_subform].Form.RecordSet
OR
This line:
Set rs = db.OpenRecordset(Me![report_tab].[Invoices_tbl_subform].RecordSource, dbOpenDynaset)
Should be:
Set rs = db.OpenRecordset(Me![Invoices_tbl_subform].Form.RecordSource, dbOpenDynaset)