You are missing a space between "Dim" and "pROCEDURA AS String"
You are trying to declare "pROCEDURA" but assign a combo box value to "pROCEDuRE"
And you use "pROCEDURA" (which is nothing) is the call to "ConvertReportToPDF"
Column is misspelled: ComboBox332.colum (0) should be ComboBox332.column (0)
The first two lines of EVERY module should be:
Code:
Option Compare Database
Option Explicit
Try this:
Code:
Dim blRet As Boolean
Dim pROCEDURA AS String
dim SaveFileName as String
'if the bound column of ComboBox332 is 1, you don't need to use ".column(0)"
pROCEDuRA = Me.ComboBox332.column(0)
Me.Testo259 = Forms!Segnalazione_Registro_Infortuni!Testo259
SaveFileName ="\\SERVER\SEGRETERIA\TRASMISSIONI\VARIE\Segnal azio ne Registro Infortuni\"
SaveFileName = SaveFileName & Me.Testo401 & " "
SaveFileName = SaveFileName & Me.Testo403 & " Prot. " '<- why the dot?? Bad naming convention IMO
SaveFileName = SaveFileName & Me.Testo259 & " del "
SaveFileName = SaveFileName & Me.Testo408 & ".pdf"
' Call our convert function
' Please note the last param signals whether to perform
' font embedding or not. I have turned font embedding ON for this example.
blRet = ConvertReportToPDF(pROCEDURA, vbNullString, SaveFileName, False, False, 150, "", "", 0, 0, 0)
Single step through the code to see if the variables (pROCEDURA & SaveFileName) have the correct values.
It would really help if you take the time to rename your controls to a meaningful name.
Me.Testo401, Me.Testo403, ComboBox332 doesn't tell you much about the data, does it?