philfloyduk
Board Regular
- Joined
- Jan 6, 2011
- Messages
- 82
Hi.
I have a sheet that contains invoiced work with payment status information on. I've created a form that auto filters the repairs to display unpaid work, also with the option to filter by invoice details. All works fine, but I would like a message box to pop up if there are not results found.
Below is the code on the existing form:
Private Sub cmdPDF_Click()
If cbInvoice.Value = "" Then
Sheets("invoice repairs").Range("g2").AutoFilter Field:=3, Criteria1:="No"
Else
Sheets("invoice repairs").Range("g2").AutoFilter Field:=3, Criteria1:="No"
Sheets("invoice repairs").Range("e2").AutoFilter Field:=1, Criteria1:=cbInvoice.Value
End If
Application.ActivePrinter = "PrimoPDF on Ne01:"
Sheets("invoice repairs").PrintOut From:=1, To:=1, Copies:=1, _
ActivePrinter:="PrimoPDF on Ne01:", collate:=True
Sheets("invoice repairs").Range("e2").AutoFilter Field:=1
Sheets("invoice repairs").Range("g2").AutoFilter Field:=3
End Sub
Many thanks in advance for any help given.
Phil
I have a sheet that contains invoiced work with payment status information on. I've created a form that auto filters the repairs to display unpaid work, also with the option to filter by invoice details. All works fine, but I would like a message box to pop up if there are not results found.
Below is the code on the existing form:
Private Sub cmdPDF_Click()
If cbInvoice.Value = "" Then
Sheets("invoice repairs").Range("g2").AutoFilter Field:=3, Criteria1:="No"
Else
Sheets("invoice repairs").Range("g2").AutoFilter Field:=3, Criteria1:="No"
Sheets("invoice repairs").Range("e2").AutoFilter Field:=1, Criteria1:=cbInvoice.Value
End If
Application.ActivePrinter = "PrimoPDF on Ne01:"
Sheets("invoice repairs").PrintOut From:=1, To:=1, Copies:=1, _
ActivePrinter:="PrimoPDF on Ne01:", collate:=True
Sheets("invoice repairs").Range("e2").AutoFilter Field:=1
Sheets("invoice repairs").Range("g2").AutoFilter Field:=3
End Sub
Many thanks in advance for any help given.
Phil