|
-
May 9th, 2001, 05:51 AM
#1
Running a MS Access Report From VB6
Hi All,
Have any of you any idea how to Print/Preview a Report which has been created in an Access Database From Visual Basic. I am developing an application which needs to generate quite complex timetables which I can do in Access using the SubReports etc, but not with the DataReport / Data Environment within VB so it would be nice to be ale to just Preview and Print the reports I've already done, Help !!!
-
May 9th, 2001, 07:11 AM
#2
Re: Running a MS Access Report From VB6
Public Sub RunReport(strDatabase As String, strReport As String)
'=============================================================================
'add ref to Acces 8.0 ( or whatever Access you have)
Dim mobjAccess As Object
Set mobjAccess = New Access.Application
' Open the database
mobjAccess.OpenCurrentDatabase strDatabase
' Open the report in preview mode using the DoCmd object
mobjAccess.DoCmd.OpenReport strReport, acPreview
' Maximize the report window
mobjAccess.DoCmd.Maximize
' Show the Access window
mobjAccess.Visible = True
Set mobjAccess = Nothing
End Sub
'to print report use acViewNormal instead of acPreview. and of course you don't need lines to miximize window and make Accesss visible
Iouri Boutchkine
[email protected]
-
May 9th, 2001, 07:18 AM
#3
Re: Running a MS Access Report From VB6
Cheers Louri for your speedy response, Just one question, will your code work for machines which do not have MS-Access Installed. Its Just not all staff who will be using it have MS-Access Installed ( Our IT Dept is a bit tight on licences ), this is why I was hesitating on going down this route . .
-
May 9th, 2001, 07:30 AM
#4
Re: Running a MS Access Report From VB6
No it will not. If you don't want to install Access then create your own report and run it from VB.
Rate it if it helped you.
Iouri Boutchkine
[email protected]
-
May 9th, 2001, 07:30 AM
#5
Re: Running a MS Access Report From VB6
It requires ms-access installed.
Name is Iouri, if I am not wrong...
:-)
Special thanks to Lothar "the Great" Haensler, Tom Archer, Bruno Paris and all the other wonderful people who made and make Codeguru a great place. Come back soon, you Gurus.
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
-
May 9th, 2001, 07:31 AM
#6
Re: Running a MS Access Report From VB6
Truly? How bad I quickly answer the wrong one!
Thanks for sharing, Iouri
Special thanks to Lothar "the Great" Haensler, Tom Archer, Bruno Paris and all the other wonderful people who made and make Codeguru a great place. Come back soon, you Gurus.
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
-
May 9th, 2001, 07:33 AM
#7
Out of votes...
I will rate you tomorrow...
Special thanks to Lothar "the Great" Haensler, Tom Archer, Bruno Paris and all the other wonderful people who made and make Codeguru a great place. Come back soon, you Gurus.
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
-
May 9th, 2001, 07:35 AM
#8
Re: Running a MS Access Report From VB6
Sorry for the Speeling mistake on your name Iouri, and I will be rating your post, but can I clarify that If I have already created a report in MS-Access 2000, and this Database file is sitting on the server, will your code preview the report on a machine which doesn't have Access Installed. ( Sorry to be Thick ! )
-
May 30th, 2001, 04:19 AM
#9
Re: Running a MS Access Report From VB6
I suggest you try EasyGrid OCX. It's very easy and powerful.
Maybe it will help you.
Download it from http://www.share2.com/easygrid/
-
May 30th, 2001, 07:10 AM
#10
Re: Running a MS Access Report From VB6
I think that you cannot preview report on th ecomputer that does not have MS Access installed
Iouri Boutchkine
[email protected]
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
|