0

I have been struggling to output the PDF report to the relevant folder within the server. The error which is showing is

RunTime error 3201, no record found.

Could you please help me to solve it?

Dim RFQNumber As String
Dim InNumber As String
Dim FullReportName As String
Dim path1 As String

RFQNumber = [Forms]![RFQ_Database]![RFQ_ExNumber]
InNumber = [Forms]![RFQ_Database]![RFQ_InNumber]
path1 = "\\AZBAK-FP02\Work\Old Server Data\V&C\" & RFQNumber & "\" & RFQNumber & " " & InNumber & ".pdf"

MsgBox (path1)

DoCmd.OutputTo acOutputReport, "AOrderFCAVienna", "PDFFormat(*.pdf)", path1, False
braX
  • 11,506
  • 5
  • 20
  • 33
Qulu Quliyev
  • 49
  • 1
  • 9
  • Have you step debugged? Are expected values retrieved from form? Which line throws error? I don't see anything wrong with OutputTo line although I prefer `acFormatPDF` for the OutputFormat parameter. Do you have permission to write to folders? – June7 Feb 07 '20 at 19:00

1 Answers1

0

I believe the ampersand in the directory path is causing the issue.

ath1 = "\\AZBAK-FP02\Work\Old Server Data\V&C\" & RFQNumber & "\" & RFQNumber & " " & InNumber & ".pdf"
                                          ^^^

you may need to add chr code

ath1 = "\\AZBAK-FP02\Work\Old Server Data\V" & Chr(38) & "C\" & RFQNumber & "\" & RFQNumber & " " & InNumber & ".pdf"

Inserting a formula containing an ampersand into a cell

Jim L
  • 173
  • 7