If collect.count = 0 Then Print "<script>alert('Sorry, No matches were found based on the specified selection criteria.')</script>" Print "<script>history.go(-1)</script>" Exit Sub End If