Text Box Doesn’t Disappear When Creating PDF

all7holly

Registered User.
Local time
Today, 14:08
Joined
Nov 16, 2011
Messages
49
I now have a text box that disappears on normal view of the report. However the code below converts the report to a PDF. When I review the PDF the text box is there. Any ideas?

Public Sub ExportPDFINVOICE(strRoot As String, strPropertyAddress As String, strprojectnumber As String, strInvoiceNumber As Long, strBillingCompany As String, rpt As String)
On Error GoTo Err_Handler
Dim strPath As String
'Root directory of your file
strPath = strRoot & "\" & strprojectnumber & " " & strPropertyAddress & "\"
Dim strFile As String
'Full address of your file
strFile = strPath & "Invoice" & " " & strInvoiceNumber & " " & strBillingCompany & " " & strPropertyAddress & " " & "Project Number" & " " & strprojectnumber & ".pdf"
'Does the directory exist? If not, create it
If Exist(strPath, vbDirectory) = 0 Then MkDir (strPath)
'Does the file exist?
If Exist(strFile) Then
Dim intResponse As Integer
intResponse = MsgBox("That file already exists! Would you like to replace it?", vbYesNo, "Error")
If intResponse = vbYes Then
Kill (strFile)
Else
 
How are you making it disappear then viewing the report? And what is the text box and why do you want it to disappear?

Normally, you need to put the code in the On Format event of the section that the control is in.
 
Hello,
I make it disappear with code when there is no data. When I open the report in normal view it works properly, however the code I listed above doesn’t open the report. It just converts it to a PDF and sends it to a folder.
 
Hello,
I make it disappear with code when there is no data. When I open the report in normal view it works properly, however the code I listed above doesn’t open the report. It just converts it to a PDF and sends it to a folder.

Do it in the ON FORMAT event of the section it is in. When you send it to PDF it should work just fine if you put the code where I said.
 

Users who are viewing this thread

Back
Top Bottom