KeythStone
New Member
- Joined
- Mar 30, 2011
- Messages
- 36
Hello to all,
What I'd like to do is publish a report to a folder on a shared drive. The below code allows this to happen.
Dim StrDocUPDINS As String
StrDocUPDINS = "N:\AR Management\Caliber\AIM Reports\UPDINS 2" & ".pdf"
If Dir(StrDocUPDINS) <> vbNullString Then
Kill StrDocUPDINS
End If
DoCmd.OpenReport "AIM (Assignment,DB)_UPDINS", acViewPreview, "", "", acIcon
DoCmd.OutputTo acOutputReport, "AIM (Assignment,DB)_UPDINS", "PDFFormat(*.pdf)", StrDocUPDINS, False, "", 0, acExportQualityPrint
DoCmd.Close acReport, "AIM (Assignment,DB)_UPDINS"
This code allows me to replace the file with the same filename (I believe): If Dir(StrDocUPDINS) <> vbNullString Then
Kill StrDocUPDINS
End If
Sometimes users are in the file and this kills the process. So we have two file names to account for this, one named UPDINS and another UPDINS 2.
Question:: How can I have it so if one file is being used Access will write to the other filename? I think it's a point of incorporating it into the If, then, else statement. Any suggestions??
Stay smooth,
KeythStone
What I'd like to do is publish a report to a folder on a shared drive. The below code allows this to happen.
Dim StrDocUPDINS As String
StrDocUPDINS = "N:\AR Management\Caliber\AIM Reports\UPDINS 2" & ".pdf"
If Dir(StrDocUPDINS) <> vbNullString Then
Kill StrDocUPDINS
End If
DoCmd.OpenReport "AIM (Assignment,DB)_UPDINS", acViewPreview, "", "", acIcon
DoCmd.OutputTo acOutputReport, "AIM (Assignment,DB)_UPDINS", "PDFFormat(*.pdf)", StrDocUPDINS, False, "", 0, acExportQualityPrint
DoCmd.Close acReport, "AIM (Assignment,DB)_UPDINS"
This code allows me to replace the file with the same filename (I believe): If Dir(StrDocUPDINS) <> vbNullString Then
Kill StrDocUPDINS
End If
Sometimes users are in the file and this kills the process. So we have two file names to account for this, one named UPDINS and another UPDINS 2.
Question:: How can I have it so if one file is being used Access will write to the other filename? I think it's a point of incorporating it into the If, then, else statement. Any suggestions??
Stay smooth,
KeythStone