?
Solved

Can't Open Access Reports

Posted on 2006-04-03
3
Medium Priority
?
203 Views
Last Modified: 2013-11-28
I have a vb6 application that opens some reports created in Access. The application works fine, except when I package and deploy the application, I can't view the reports from the machine in which it was installed. This is the code that opens the reports:

With AccessApp
    .OpenCurrentDatabase "\\server\Shared\SomeFolder\MyDb.mdb"
    .RunCommand acCmdWindowHide
    .RunCommand acCmdAppMaximize
    .DoCmd.OpenReport cmbReports.Text, acViewPreview
    .DoCmd.Maximize
   End With
   On Error Resume Next
Set AccessApp = New Access.Application

I can manually locate the Access database and open the reports on the machine that the application is installed, but the application will not open the reports. Any Help?
0
Comment
Question by:Gary2397
  • 2
3 Comments
 
LVL 28

Assisted Solution

by:vinnyd79
vinnyd79 earned 1500 total points
ID: 16365279
If you take the "On Error" Line out does it throw an error?  Does it help if you change to the db's directory first?


Private Declare Function SetCurrentDirectory Lib "kernel32" Alias "SetCurrentDirectoryA" (ByVal lpPathName As String) As Long



Private Sub Command1_Click()

SetCurrentDirectory "\\server\Shared\SomeFolder"

Set AccessApp = New Access.Application

With AccessApp
    .OpenCurrentDatabase "\\server\Shared\SomeFolder\MyDb.mdb"
    .RunCommand acCmdWindowHide
    .RunCommand acCmdAppMaximize
    .DoCmd.OpenReport cmbReports.Text, acViewPreview
    .DoCmd.Maximize
End With

End Sub
0
 

Author Comment

by:Gary2397
ID: 16365688
The avove code didn't allow me to view. But I took out the "On Error Resume Next" and received the message "Run-Time error '429' ActiveX component can't create object". I will research this error.
0
 
LVL 28

Accepted Solution

by:
vinnyd79 earned 1500 total points
ID: 16366445
0

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Sometimes MS breaks things just for fun... In Access 2003, only the maximum allowable SQL string length could cause problems as you built a recordset. Now, when using string data in a WHERE clause, the 'identifier' maximum is 128 characters. So, …
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question