msvisual.com Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Preview Access report

 
Post new topic   Reply to topic    msvisual.com Forum Index -> OLE Automation
Author Message
elena



Joined: 04 Oct 2007
Posts: 9

PostPosted: Wed May 02, 2007 2:46 pm    Post subject: Preview Access report Reply with quote

Hi, All
I have Access report which i can print with no problem, but view feature
doesn't work, What am i doing wrong in the code?
Please, help

Set objAccess = New Access.Application
With objAccess
.OpenCurrentDatabase (strDB)
.DoCmd.OpenReport sReportName, acViewPreview - doesn't work....

.DoCmd.Close acReport, sReportName
.Application.CloseCurrentDatabase
End With
If Not objAccess Is Nothing Then
objAccess.Quit
Set objAccess = Nothing
End If

Archived from group: microsoft>public>vb>ole>automation
Back to top
View user's profile Send private message
Paul Clement



Joined: 04 Oct 2007
Posts: 1560

PostPosted: Mon May 07, 2007 2:49 pm    Post subject: Re: Preview Access report Reply with quote

On Wed, 2 May 2007 10:46:01 -0700, elena wrote:

¤ Hi, All
¤ I have Access report which i can print with no problem, but view feature
¤ doesn't work, What am i doing wrong in the code?
¤ Please, help
¤
¤ Set objAccess = New Access.Application
¤ With objAccess
¤ .OpenCurrentDatabase (strDB)
¤ .DoCmd.OpenReport sReportName, acViewPreview - doesn't work....
¤
¤ .DoCmd.Close acReport, sReportName
¤ .Application.CloseCurrentDatabase
¤ End With
¤ If Not objAccess Is Nothing Then
¤ objAccess.Quit
¤ Set objAccess = Nothing
¤ End If

What do you mean by "doesn't work"? Is an error message being generated?


Paul
~~~~
Microsoft MVP (Visual Basic)

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    msvisual.com Forum Index -> OLE Automation All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group