Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Accessing MSAccess Forms & Reports from VB6

Status
Not open for further replies.

ptyFrankie

Technical User
May 29, 2003
6
0
0
PA
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

 
Have you used the advanced search first?

thread709-420058
thread222-367246
thread222-426238
 
Thanks for the help, I really need something that doesn't need Access in the client machine. So must probably the snapshot option will be the best.

Now my question would be how do I pass parameters, from a VB form, to the querys that generates the report?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top