|
-
Oct 18th, 1999, 11:33 AM
#2
New Member
It took me forever to find this code, but got it in one of the best db books around.. Database Access With VB6 by Jeffery Mcmanus..
' you need your access ref obj lib
Dim MSACCESS as Access.application
Private Sub PrintReport_Click()
Set MSACCESS = New Access.Application
MSACCESS.OpenCurrentDatabase ("c:\your dir\Your.mdb") ' This opens your db..
MSACCESS.DoCmd.OpenReport "YourReportHere", acViewNormal This actualy opens your report from your Access (97?) db & then prints it..
MSACCESS.CloseCurrentDatabase ' self explanitory
Set MSACCESS = Nothing ' You need this, or you will keep access in memory & lag the user..
There you have it!!! Use this code well & may all your reports print perfect!
------------------
~\*/~ Thank you....
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|