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

How to set the recordset to a REPORT?

Status
Not open for further replies.

softlover

Programmer
Apr 4, 2002
88
CN
I used to set the recordset of a report with codes below.
Set Me.Recordset = MyRst
But failed. Anyone help me with it and give me more codes.
 
It's supposed to work very well, as long as you're working with ADP's. The usual (and true) message when working with mdb's are "2593 This feature is not available in an MDB".

Usually, with a tad more info (for instance the exact errormessage, what technology you're using (adp/mdb), somewhat more of the code...) it's easier to find out what's going on.

If you haven't read faq181-2886, yet, please do.

Roy-Vidar
 
I work with MDB files under ACCESS2K and I want to transfer the recordset created in a form to a report which opened from the form via a command button. More codes below.
Dim stDocName As String
stDocName = "MyReport"
DoCmd.OpenReport stDocName, acViewDesign
With Reports(stDocName)
.RecordSource = Me.Recordset
End With
DoCmd.OpenReport stDocName, acPreview
But these codes can't work and report "Invalid parameter group".
 
And this ?
.RecordSource = Me.RecordSource

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks to PHV.
I had tried the codes ".RecordSource = Me.RecordSource" but still failed with message "can't found the source table".
Please notice that the source table isn't existed in the local database file.
In order to share use a database with my friends, I put the source database file with source table in a share folder into a PC inside the LAN. Then use following codes to read the remote database on the remote PC.

Set MyWsp = DBEngine.Workspaces(0)
Set MyDb = MyWsp.OpenDatabase(LinkShareFile, False, False)
Set MyRst = MyDb.OpenRecordset("MyTable", dbOpenDynaset)
Set Me.Recordset = MyRst

Go back to the previously problem, the form were depended on the remote recordset "MyRst". And I need the new REPORT also depends on the "MyRst".

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top