Access 2007 error 2950, even in trusted area

Posted on 2012-04-09
Medium Priority
Last Modified: 2012-04-17
I call an Access 2007 macro with a shell command from VB6.
The macro runs fine until end when it calls a vba code module, and produces error 2950 ( 2950 is supposed to be because DB is in untrusted path).

I went into Access, and added this server folder as trusted location.

The code module that results in error 2950 is:

Function WorkPeriodHoursReport()
Dim i As Integer
On Error Resume Next
Kill "C:\RWH2\" & "MyReport" & ".pdf"
  DoCmd.OutputTo acOutputReport, "WorkPeriodHoursReport", acFormatPDF, "C:\RWH2\" & "MyReport" & ".pdf", False

'Method 1
Application.FollowHyperlink ("C:\RWH2\MyReport.pdf")

'or Method 2
Dim MyShell As Variant
'MyShell = Shell("C:\RWH2\printPDF.bat", vbMinimizedNoFocus)
End Function

Funny thing is that it worked in past!

Need fix fast for client - 500 points!
Any fix appreciated!

Question by:Larry Biederman
  • 4
LVL 120

Assisted Solution

by:Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1) earned 200 total points
ID: 37825490
try this setting
Office Button > access options > trust center > trust center settings > macro settings > enable all macros

Author Comment

by:Larry Biederman
ID: 37825712
I did set enable all macros.  Also added Q:\ drive as trusted area.
Doesn't work.

Thanks for input!!

Accepted Solution

Larry Biederman earned 0 total points
ID: 37838963
If I "OutputTO" a blank report first, it works!

Author Comment

by:Larry Biederman
ID: 37851813
I gave the expert 100 points for a single reply.
Although didn't fix, I ap[preciated efforts.

If moderator wants to give him all 500 points, ok.
Whatever is fair.


Author Closing Comment

by:Larry Biederman
ID: 37854960
Other solution didn't work.  Somehow OutputTO a report that's blank first worked.

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
If you’re using QODBC to update QuickBooks data from Microsoft® Access but Access is not showing the updated data, you could have set up QODBC incorrectly.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

597 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