ipbr21054
Well-known Member
- Joined
- Nov 16, 2010
- Messages
- 5,832
- Office Version
- 2007
- Platform
- Windows
Morning,
I am using the code supplied below.
Currently with my userform open when the button OPEN INVOICE is pressed the code opens up the invoice which is saved on the pc by its invoice number which is shown in the userform invoice number field.
If N/A is in the field then i see the message box no problem.
If say 123 is shown in the field then invoice 123 is then opened & now seen no problem.
This is the issue i have come across, should 150 be in the invoice number field BUT the invoice 150 for some reason had been deleted from the pc upon pressing the OPEN INVOICE button nothing happens,it should at least advise me that no invoice was not found.
Many thanks
I am using the code supplied below.
Currently with my userform open when the button OPEN INVOICE is pressed the code opens up the invoice which is saved on the pc by its invoice number which is shown in the userform invoice number field.
If N/A is in the field then i see the message box no problem.
If say 123 is shown in the field then invoice 123 is then opened & now seen no problem.
This is the issue i have come across, should 150 be in the invoice number field BUT the invoice 150 for some reason had been deleted from the pc upon pressing the OPEN INVOICE button nothing happens,it should at least advise me that no invoice was not found.
Many thanks
Code:
Private Sub OpenInvoice_Click() If IsNumeric(txtInvoiceNumber.Value) Then
CreateObject("Shell.Application").Open "C:\Users\Ian\Desktop\REMOTES ETC\DR COPY INVOICES\" & txtInvoiceNumber.Value & ".pdf"
Else
MsgBox "Invoice N/A For This Customer"
End If
End Sub