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

using form recordset for report recordset

Status
Not open for further replies.

nhtraven

Technical User
Dec 10, 2000
114
US
I am using a form (frmA) to fire multiple queries, which in turn, each query run fires a continuous form (frm1). On this form ( frm1) there are 2 frames with options ( reporttype with 3 options, and whatrecords with two options) whatrecord option1 is tagged, which has a yes/no checkbox in the detail beside each record. option2 is all records in the dynaset. I want to take frm1 recordset and filter on the checkbox value <true tagged> and send this dynaset to the report. The report is a summary report with more then one record that should display. Problem is the report recordsource. The queries are parameter queries, requesting user to enter parameter in a inbox box < from query, bound to frm1> I thought i should use the recordsetclone and filter the records, but now i am stuck, and getting an object required error
here is the code:

i have made a module with the dim statements for dao database and recordset thinkin that would help

Dim stDocName As String
Dim strfilter As String
stDocName as String
'Dim rst As DAO.Recordset
'Set db = CurrentDb()
Set rst = Me.RecordsetClone
rst.MoveLast
MsgBox rst.RecordCount
rst.Filter = (Me!PrintTag = True)
Set rst = rst.OpenRecordset(rst)
rst.MoveLast

MsgBox rst.RecordCount
DoCmd.OpenReport stDocName, acViewPreview
Reports!rptGBA.recordset = rst.recordset
'close rst in report after run

stDocName = &quot;&quot;

stDocName = &quot;rptGBAind&quot;
'Individual report bound to form and works fine
If RecType = 2 And WhatRec = 2 Then
strfilter = (Me!PrintTag = True)

DoCmd.OpenReport stDocName, acViewPreview, strfilter


End If


well that is all the recordset code, and it does not work. anyone have any ideas????
thanks in advance


 
Can anyone help to point me in the right directions with this??? i have frm1 bound to the query, but am at a loss as to how to bind the group of records to the report. There has to be a way to do this. I have check msdn, knowledge base and this forums search. I have bound each field in the report to frm1 and have the first record. In the report open event procedure If i use a do until rst.EOF and move all the records to tthe individual field names on the report would that move the records to report ?
just point me to the right direction please. Has anyone had to do this? or have done it?
I am going to be bald before i finish this project = 0
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top