Private Sub btnSearch_Click()
On Error GoTo Err_btnSearch_Click
If IsNull(Me.txtSearchValue) Or Len(Me.txtSearchValue) = 0 Then
MsgBox "You must enter a Value to Search for in the textBox"
Me.txtSearchValue.SetFocus
Exit Sub
End If
If Left(Me.txtSearchValue, 1) Like "[0-9]" Then
'searching for number
MsgBox "Use code to search for Number " & vbCrLf _
& "select * from tblEmployees where [employee number] =" & CLng(Me.txtSearchValue)
Else
'searching for Name
MsgBox "Use code to search for Surname " & vbCrLf _
& "select * from tblEmployees where [name] = '" & Me.txtSearchValue & "'"
End If
Exit_btnSearch_Click:
Exit Sub
Err_btnSearch_Click:
MsgBox Err.Description
Resume Exit_btnSearch_Click
End Sub