Saving report to sharepoirnt site (1 Viewer)

dvance24

New member
Local time
Today, 09:06
Joined
May 2, 2012
Messages
6
I AM GOING MAD! REALLY GRRRR!
I cant believe that I am unable to find this answer anywhere! SO PLEASE FOR THE LOVE OF ALL GOOD CODE EVERYWHERE PLEASE help ME!

I just want to out put my reports to a sharepoint site, yes i have access to the sharepoint site! Thats all! I have tested it and i runs just fine when I run it against my C drive! here is my code, please someone help me!

Just a little background, I am creating a report for each group type to be linked into a xcelcius report later, hence the looping.

Dim sLoc As String, sLocNew As String
sLoc = "\\teams.aexp.com/sites./gbo.shares/Documents/VOC/DB_Hyperlink_Docs/"
Dim RS As dao.Recordset, rsCOMM As dao.Recordset
Dim sSQL As String, sISQL As String
DoCmd.SetWarnings False
DoCmd.RunSQL "delete * from tblhyperlink"
Set RS = CurrentDb.OpenRecordset("SELECT voc_desc FROM tblmainbreakdown group by voc_desc ORDER BY VOC_DESC;", dbOpenDynaset)
'loops through all the difference VOC types
Do While (Not RS.EOF)
'query for the report
sSQL = "SELECT voc_desc,datetimeend,voc_week,resp1,ans1,voc_comme nts,reg_concern,switchid FROM tblmainbreakdown " _
& "WHERE VOC_DESC = " & "'" & RS.Fields("Voc_desc") & "'" & " and not isnull(voc_comments)" _
& "GROUP BY voc_desc,datetimeend,voc_week,resp1,ans1,voc_comme nts,reg_concern,switchid order by datetimeend"
CurrentDb.QueryDefs("qryHyperComm").SQL = sSQL

'looks for text within the description that could give an incorrect filename
sLocNew = Replace(RS.Fields("Voc_desc").value, "/", "_")
sLocNew = Replace(sLocNew, "&", "And")
sLocNew = Replace(sLocNew, "%", "Prcnt")
sLocNew = Replace(sLocNew, ".", "_")
sLocNew = Replace(sLocNew, " _ ", "_")

Debug.Print sLoc & sLocNew & ".pdf"
'output the report
DoCmd.OutputTo acOutputReport, "rptVOC_Comments", "PDFFormat(*.pdf)", sLoc & sLocNew & ".pdf", False, acExportQualityScreen

'saves hyperlink location to table to be used later for users to lookup
sISQL = "insert into tblHyperlink (link_voc_desc, regcon,link) " _
& "SELECT voc_desc,reg_concern, '" & sLoc & sLocNew & ".pdf ' as LinkFormat from tblmainbreakdown " _
& "WHERE VOC_DESC = " & "'" & RS.Fields("Voc_desc") & "'" & " group by voc_desc,reg_concern "
DoCmd.RunSQL sISQL
RS.MoveNext
Loop
RS.Close
Set RS = Nothing
Set rsCOMM = Nothing
DoCmd.SetWarnings True

EXITPOINT:
On Error GoTo 0
Exit function
ERRTRAP:
MsgBox Err.Number & " - " & Err.Description
Resume EXITPOINT
 

dvance24

New member
Local time
Today, 09:06
Joined
May 2, 2012
Messages
6
did I tell you that a collegue of my gave me the answer! took him 10 minutes! (10 MINUTES REALLY! dont know whether to thank him or to #$&#*&$ !) of course he is a web developer and I hadnt asked him before now, helps to ask the right people!

so the answer is that you have to have the full web path, so my location would be:
sLoc = "https//temas.aexp.com/sites/gbo/shared%20ducments/voc/db_hyperlink_docs/"

hopes this helps someone else!
 

Users who are viewing this thread

Top Bottom