|
-
Oct 15th, 2002, 07:41 AM
#1
Thread Starter
Addicted Member
Access Reports
Can i run a report created in Access fron VB. If i can how can i do it?
-
Oct 15th, 2002, 07:50 AM
#2
PowerPoster
If you're using Access 2000 and newer then you cannot run Access report as stand along - you will need to automate Access:
VB Code:
Private Sub Command1_Click()
'=======================
RunAccessReport App.Path & "\nwind.mdb", "Catalog"
End Sub
Public Sub RunAccessReport(strDB As String, strReport As String)
'================================================================
Dim AccessDB As Access.Application
Set AccessDB = New Access.Application
AccessDB.OpenCurrentDatabase strDB
AccessDB.DoCmd.OpenReport strReport, acViewPreview
AccessDB.Visible = True
AccessDB.Quit acQuitSaveAll
Set AccessDB = Nothing
End Sub
If you're using Access 97 then it should be an ocx out there from a third party to do that.
-
Oct 15th, 2002, 07:53 AM
#3
You can use the same automation techinques with Access 97. That is where I first learned how. (For that matter, you can use this with Access 95 providing you are equipped with the proper references.)
-
Oct 15th, 2002, 07:55 AM
#4
If you take a look at the Access VBA help, there's a DoCmd.OpenReport method which'll help you out...
-
Oct 15th, 2002, 08:06 AM
#5
PowerPoster
You can use the same automation techinques with Access 97
Oh, certainly. This can be used with any version of Access as long as the refences are OK.
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
|