ipbr21054
Well-known Member
- Joined
- Nov 16, 2010
- Messages
- 5,738
- Office Version
- 2007
- Platform
- Windows
Hi,
The working code supplied below is what i use to view a saved invoice.
What i am looking for is to now use the same code but with an edit.
Once the button is pressed it will look for the invoice number & print it as opposed to viewing it.
Thanks
The working code supplied below is what i use to view a saved invoice.
What i am looking for is to now use the same code but with an edit.
Once the button is pressed it will look for the invoice number & print it as opposed to viewing it.
Thanks
Code:
Private Sub OpenInvoice_Click()
Const FILE_PATH As String = "C:\Users\Ian\Desktop\REMOTES ETC\DR COPY INVOICES\"
If txtInvoiceNumber = "N/A" Or Len(txtInvoiceNumber) = 0 Then
MsgBox "Invoice N/A For This Customer", vbExclamation, "N/A INVOICE NOTICE"
Else
If Len(Dir(FILE_PATH & txtInvoiceNumber.Value & ".pdf")) = 0 Then
If MsgBox("Would You Like To Open The Folder ?", vbCritical + vbYesNo, "Warning Invoice is Missing.") = vbYes Then
CreateObject("Shell.Application").Open ("C:\Users\Ian\Desktop\REMOTES ETC\DR COPY INVOICES\")
End If
Else
CreateObject("Shell.Application").Open (FILE_PATH & txtInvoiceNumber.Value & ".pdf")
End If
End If
End Sub