
03-29-2004, 02:37 PM
|
|
Newcomer
|
|
Join Date: Mar 2004
Posts: 3
|
|
Access Report from VB
|
Hello all. I'm having an issue with my vb app calling out an access report, I hope someone can help me out. I created a vb6 application that runs a report that is available in access. The original access report has a query that uses a date range to display the records. When I run the report from the vb app it runs the date range query twice. Is there something I'm forgetting to do?
Here's the code for it:
Public Sub cmdReport_Click()
On Error Resume Next
Set appAccessReport = New Access.Application
SnapShotFile = App.Path & "1.snp"
SnapShotFile = Replace(SnapShotFile, "/", "-")
appAccessReport.OpenCurrentDatabase ("\\Mainserver\Shared Drive\Time Sheets\Reports.mdb")
appAccessReport.DoCmd.OutputTo acOutputReport, "rptTimeSheet", acFormatSNP, SnapShotFile, 0
frmReport.snpReport.SnapshotPath = SnapShotFile
appAccessReport.DoCmd.OpenReport "rptTimeSheet", acViewPreview
frmReport.Show
appAccessReport.Quit
Set appAccessReport = Nothing
End Sub
The access query just has "Between [Enter Starting Date] And [Enter Ending Date]" within the criteria section. Thanks in advance.
|
|