Hey RayMilhon,
I figured out and it works like a charm
In your code I add extra line, regadless I have now two Form and now my WORKING code looks like this:
Code:
Private Sub PDFbtn_Click()
Dim myPath As String
Dim strReportName As String
If IsNull([Client]) Then
DoCmd.OpenReport "Form2", acViewPreview, acWindowNormal, "ID=" & ID
Else
DoCmd.OpenReport "Form1", acViewPreview, acWindowNormal, "ID=" & ID
End If
myPath = "C:\Contracts\"
strReportName = [Name] & "_" & [LastName] & "_" & [ContractNr] & ".pdf"
DoCmd.OutputTo acOutputReport, "Form1", acFormatPDF, myPath + strReportName, True
DoCmd.OutputTo acOutputReport, "Form2", acFormatPDF, myPath + strReportName, True
If IsNull([Client]) Then
DoCmd.Close acReport, "Form2"
Else
DoCmd.Close acReport, "Form1"
End If
End Sub
Thank you very much for all suggestion and help.
Now I can go to try make some Queries for rental list per Client and per Customer
Thanks again,
Best regards,
Lali