I have the following code. I would like to know how I can add a message box that will tell me/the user if no records are found rather than open the display/results form.
Private Sub Command16_Click()
Dim strSource As String
strSource = "SELECT * FROM [Adminstration]" & _
"where (([Adminstration].[User]) LIKE (""*"" & 'Printer' & ""*"" ))" & _
" ORDER BY [Division],[Location]"
DoCmd.OpenForm "Printer Results", , , , , , strSource
End Sub
Private Sub Command16_Click()
Dim strSource As String
strSource = "SELECT * FROM [Adminstration]" & _
"where (([Adminstration].[User]) LIKE (""*"" & 'Printer' & ""*"" ))" & _
" ORDER BY [Division],[Location]"
DoCmd.OpenForm "Printer Results", , , , , , strSource
End Sub