Oops, spoke to soon. Here's my code with the "OutputTo"
line added. When it exports the report it contains the
entire table. I need to export the report I get with
the "UserID" field as the filter.
Set objAccess = CreateObject("Access.Application")
With objAccess
.OpenCurrentDatabase filepath:=dbName
.Visible = False
.DoCmd.OpenReport rptName, , , "[UserID] = " &_
PrintUserID
.DoCmd.OutputTo acReport, rptName,_
acFormatSnapshot, "C:\Data\" &_ dataUser.Recordset!Name_
& ".snp"
.Quit
End With
Set objAccess = Nothing
-----Original Message-----
Excellent! Thank you.
-----Original Message-----
Keith:
Dim objAccess as Object
Const acReport = 3
Const acFormatSnapshot = "Snapshot Format (*.snp)"
Set objAccess = CreateObject("Access.Application")
objAccess.OpenCurrentDatabase("C:\some dir\some
file.mdb")
objAccess.DoCmd.OutputTo acReport, "YourReportName",
acFormatSnapshot, _
"c:\some dir\some output file.snp"
DoEvents
objAccess.Quit
Set objAccess = Nothing
--
Steve Arbaugh
ACG Soft
http://ourworld.compuserve.com/homepages/attac-cg
message
I generate a report from VB and would like to export
(as
snapshot) the report as well after the report has been
generated. I haven't a clue how to do it from VB and
I've
been searching through help files with no luck so far.
Any
help would be appreciated.
Thanks.
.
.