J
jason
hi there. i have a search button coded to search and
display results. if the user does not enter any search
criteria i have a msgbox pop up telling them to do so.
If the user types in search criteria and it finds no
results it displays nothing but what i want it to do is
pop up a message box saying "no matches found"
does anyone know code to do this
here is my current code for the search button:
Dim stDocName As String
Dim stLinkCriteria As String
If Len(Me.Text0 & "") = 0 Then
MsgBox "Please Enter Search Criteria.",
vbOKOnly, "Error"
Me.Text0.SetFocus
Else
stDocName = "Everything"
stLinkCriteria = "([User Info_User Name] Like ""*" &
Me.Text0 & _
"*"") OR ([User ID] Like ""*" & Me.Text0 & _
"*"") OR ([Extension] Like ""*" & Me.Text0 & _
"*"") OR ([Cubicle Number] Like ""*" & Me.Text0 & _
"*"") OR ([Location] Like ""*" & Me.Text0 & _
"*"") OR ([LAN Jack 1] Like ""*" & Me.Text0 & _
"*"") OR ([Switch Jack 1] Like ""*" & Me.Text0 & _
"*"") OR ([LAN Jack 2] Like ""*" & Me.Text0 & _
"*"") OR ([Switch Jack 2] Like ""*" & Me.Text0 & _
"*"") OR ([LAN Jack 3] Like ""*" & Me.Text0 & _
"*"") OR ([Switch Jack 3] Like ""*" & Me.Text0 & _
"*"") OR ([LAN Jack 4] Like ""*" & Me.Text0 & _
"*"") OR ([Switch Jack 4] Like ""*" & Me.Text0 & _
"*"") OR ([Phone Jack 1] Like ""*" & Me.Text0 & _
"*"") OR ([Phone Jack 2] Like ""*" & Me.Text0 & "*"")"
DoCmd.OpenForm stDocName, , , stLinkCriteria
display results. if the user does not enter any search
criteria i have a msgbox pop up telling them to do so.
If the user types in search criteria and it finds no
results it displays nothing but what i want it to do is
pop up a message box saying "no matches found"
does anyone know code to do this
here is my current code for the search button:
Dim stDocName As String
Dim stLinkCriteria As String
If Len(Me.Text0 & "") = 0 Then
MsgBox "Please Enter Search Criteria.",
vbOKOnly, "Error"
Me.Text0.SetFocus
Else
stDocName = "Everything"
stLinkCriteria = "([User Info_User Name] Like ""*" &
Me.Text0 & _
"*"") OR ([User ID] Like ""*" & Me.Text0 & _
"*"") OR ([Extension] Like ""*" & Me.Text0 & _
"*"") OR ([Cubicle Number] Like ""*" & Me.Text0 & _
"*"") OR ([Location] Like ""*" & Me.Text0 & _
"*"") OR ([LAN Jack 1] Like ""*" & Me.Text0 & _
"*"") OR ([Switch Jack 1] Like ""*" & Me.Text0 & _
"*"") OR ([LAN Jack 2] Like ""*" & Me.Text0 & _
"*"") OR ([Switch Jack 2] Like ""*" & Me.Text0 & _
"*"") OR ([LAN Jack 3] Like ""*" & Me.Text0 & _
"*"") OR ([Switch Jack 3] Like ""*" & Me.Text0 & _
"*"") OR ([LAN Jack 4] Like ""*" & Me.Text0 & _
"*"") OR ([Switch Jack 4] Like ""*" & Me.Text0 & _
"*"") OR ([Phone Jack 1] Like ""*" & Me.Text0 & _
"*"") OR ([Phone Jack 2] Like ""*" & Me.Text0 & "*"")"
DoCmd.OpenForm stDocName, , , stLinkCriteria