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

Create report at Runtime Report

Status
Not open for further replies.

billheath

Technical User
Mar 17, 2000
299
US
How do I create a report using a recorset in visual basic? When I try to set the recordsource to the recordset I get a type mismatch error.
Reports!GradeResults.RecordSource = rst

Help
Thanks,
Bill
 
What exactly are you trying to do? If you have a report that you need to limit which items are shown at run-time, you can set the Filter property to an SQL WHERE clause without the word WHERE.
 
dds82,
I am trying to write a test eveluation report. I am using 4 tables. 1.Correct answers 2. students test answers 3. a table with student's profiles 4.test results table
I have written code to see which test is taken, compare correct answers with student's answers and write to a simple test results table containing student number, date, test taken and final grade.

I am using 4 recordsets to work withthe tables. In addition, i have used a matrix to list the incorrect answers and give the corrections and study resources.

I want to produce a report for the student with his name, date, grade and a list of incorrect answers. The body of the report will list the corrections and study resources.

The code I have written places all of the report information in a single recordset but I can't get the report to use the information in the recordset without putting it in another table.

I was hoping to avoid the step of making a tempory table. I tried to set the report recordsource to the recordset. That's when I get the type mismatch error.
Thanks
Bill
 
I still don't understand completely where the data is stored.

Is all the data you want to include in the report stored in the test results table?
 
try:
Reports!GradeResults.RecordSource = rst.Name

IIRC the Name property of a recordset is 1st 256 characters of the SQL behind it. As long as your SQL is shorter than that, you should be ok.

HTH

Ben

----------------------------------
Ben O'Hara
Home: bpo@RobotParade.co.uk
Work: bo104@westyorkshire.pnn.police.uk
Web: ----------------------------------
 
ddds82,
No, The table Test Results only has student name, date, test and grade.
The infomation on questions missed, study guides etc. do not need to be stored.
All of the other data is looked up or calculated within the module. I guess I need ti know how to create a report using the data within the module.
Thanks,
Bill
Thanks to Ben also
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top