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

CreateReport Method Not Working 1

Status
Not open for further replies.

Quintios

Technical User
Mar 7, 2002
482
US
Here's my code:

Code:
Sub NormalReport()
    Dim rpt As Report
    Dim strReport As String
    
    strReport = "zrptActionTables"

    Set rpt = CreateReport(, strReport)   ' Create minimized report.
    rpt.RecordSource = "qryStepActions_Design"
    
    DoCmd.Restore                            ' Restore report.
    
    Set rpt = Nothing
    
End Sub

Every time it brings up a blank report, and not the report that I specify. According to the help files it's supposed to be a report template. Is a report template different than a regular report? If so, in what way? I basically used the wizard to create a new report, edited it to taste, and saved it with the name above (I've double-checked it to be sure). But still I get the blank report.

Thanks for your help!

thx!

Q-
 
Q,

This is from the Microsoft Knowledge Base -

SUMMARY
This article discusses the Microsoft Access functions CreateForm() and CreateReport(). If you intend to write your own form wizard or report wizard, you can use these functions to create and customize a blank form or report to which you can add controls.

MORE INFORMATION
The CreateForm() and CreateReport() functions are the Visual Basic code equivalents of creating a new form or report in Design view. When you run these functions, they create a new blank form or report in a minimized state.

Both functions return an object value that you can use for further manipulation, and neither function requires parameters.


Basically, you will create a blank template every time you use CreateReport, after that you will have to create the controls for the report, etc to get the look and feel that you desire.

If you want to open a report that you have already created
you need to use DoCmd OpenReport "YourReportName"


Steve
 
Hmmmm, that stinks. :(

Thanks for your help!

thx!

Q-
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top