Larry Biederman
asked on
Access 2007 error 2950, even in trusted area
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.FollowHyperlin k ("C:\RWH2\MyReport.pdf")
'or Method 2
Dim MyShell As Variant
'MyShell = Shell("C:\RWH2\printPDF.ba t", vbMinimizedNoFocus)
End Function
Funny thing is that it worked in past!
Need fix fast for client - 500 points!
Any fix appreciated!
-Larry
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.FollowHyperlin
'or Method 2
Dim MyShell As Variant
'MyShell = Shell("C:\RWH2\printPDF.ba
End Function
Funny thing is that it worked in past!
Need fix fast for client - 500 points!
Any fix appreciated!
-Larry
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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.
lbiederman
Although didn't fix, I ap[preciated efforts.
If moderator wants to give him all 500 points, ok.
Whatever is fair.
lbiederman
ASKER
Other solution didn't work. Somehow OutputTO a report that's blank first worked.
ASKER
Doesn't work.
Thanks for input!!