ptyFrankie
Technical User
Hi! Im trying to create an application with Visual Basic 6.0 to gain access to forms and reports that actually exists in a database (created with Access2000). Im using this code but when I run it nothing happens, no form or report is opened. Actually what I do is to create a snapshot file, and present that, so actually this is more or less solved. But some of these reports are created from querys that ask for some parameters, for example from which date to what other do you want to run the report. For this cases I would like to pass information from textboxes to those report querys, but I don't know how to do this.
I would appreciate some help as soon as possible!
Best Regards!
Frank!
---------- just the open report procedure....
Private Sub Command2_Click()
On Error Resume Next
Set AccessApp = New Access.Application
With AccessApp
.OpenCurrentDatabase "c:\2030\db1.mdb"
'rpta is a report that exist in db1.mdb
.DoCmd.OpenReport "rpta", acViewPreview
End With
AccessApp.Quit
Set AccessApp = Nothing
End Sub
----- This actually works (with snapshots) but don't know how to pass parameters to the querys that generates the report
Private Sub Command2_Click()
On Error Resume Next
Set AccessApp = New Access.Application
With AccessApp
.OpenCurrentDatabase "c:\2030\db1.mdb"
.DoCmd.OutputTo acOutputReport, "rpta",acFormatSNP, "c:\2030\a.snp", False
End With
snpViewr1.SnapshotPath = "c:\2030\a.snp"
AccessApp.Quit
Set AccessApp = Nothing
End Sub
I would appreciate some help as soon as possible!
Best Regards!
Frank!
---------- just the open report procedure....
Private Sub Command2_Click()
On Error Resume Next
Set AccessApp = New Access.Application
With AccessApp
.OpenCurrentDatabase "c:\2030\db1.mdb"
'rpta is a report that exist in db1.mdb
.DoCmd.OpenReport "rpta", acViewPreview
End With
AccessApp.Quit
Set AccessApp = Nothing
End Sub
----- This actually works (with snapshots) but don't know how to pass parameters to the querys that generates the report
Private Sub Command2_Click()
On Error Resume Next
Set AccessApp = New Access.Application
With AccessApp
.OpenCurrentDatabase "c:\2030\db1.mdb"
.DoCmd.OutputTo acOutputReport, "rpta",acFormatSNP, "c:\2030\a.snp", False
End With
snpViewr1.SnapshotPath = "c:\2030\a.snp"
AccessApp.Quit
Set AccessApp = Nothing
End Sub