|
-
May 21st, 2000, 04:06 PM
#1
Thread Starter
New Member
Hi Everybody
How can I run a report from Ms Access 97 in a VB 6 application?
Thanks for the Info
Clyde
-
May 22nd, 2000, 05:51 PM
#2
Junior Member
this should do it - the "id = 5" bit means it will only print the report for any records where the id field (a field called id) is = 5
the acNormal bit means it will print, acPreview means just view
get back to me if this does not help
Dim stDocName As String
Dim accApp As Access.Application
Set accApp = New Access.Application
accApp.OpenCurrentDatabase (App.Path & "\database.mdb")
stDocName = "My Access Report"
accApp.DoCmd.OpenReport stDocName, acNormal, , _
"ID = 5" 'add query statement here if you want
accApp.CloseCurrentDatabase
-
May 23rd, 2000, 03:10 PM
#3
Junior Member
I don't know if you can do that - you would need the MSAccess 8.0 object on your system. If you can get that without installing Access then you probably can. Although any time you open a report in Access (even just to print it) it opens Access itself for a second. So no would be my final guess. You could always use the new report designer in VB6.0 - it is similar to Access, but none of the handy wizards. Thems are my thoughts for what they are worth.
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
|