Hello.
I have a form with a pdf output button. The button has this code:
Code:
Private Sub Comando18_Click()
Me.Refresh
Dim myPath As String
Dim stDocName As String
Dim theFileName As String
stDocName = "Hoja de Pedido"
DoCmd.OpenReport stDocName, acPreview, , "NumPedido = " & Nz(Me.NumPedido, 0)
myPath = "C:\"
theFileName = "Pedido " & NumPedido & ".pdf"
DoCmd.OutputTo acOutputReport, stDocName, acFormatPDF, theFileName, False
End Sub
So everytime I press the button I get a pdf file. I want to make a macro that allows me to loop this task with all the records loaded in the form, generating a single pdf for each.
How can I do it??
thanks a lot.
Offtopic: as I said in a previous thread, my code always outputs in My Documents (not in mypath), if anyone knows how to fix this...