View Full Version : Code to Create New Report


loo8866
05-13-2007, 09:52 AM
Hi there, does any1 know of a line of code which creates a new report?

Ive had a try and look round the forums with no luck...

Cheers

Morten R
05-13-2007, 12:39 PM
Private Sub Kommando16_Click()
On Error GoTo Err_Kommando16_Click

Dim stDocName As String

stDocName = "yourReportName"
DoCmd.OpenReport stDocName, acPreview

Exit_Kommando16_Click:
Exit Sub

Err_Kommando16_Click:
MsgBox Err.Description
Resume Exit_Kommando16_Click

End Sub