M
Mike Saifie
I have this data access database which I modifed.
In the Search form code I need it to modify code so, it look and match more
then one field. If the record is not in one field then it should go and look
for the second one or third. pl see the code. pl some one hlep me.
Thanks.
Mike
Option Compare Database
Option Explicit
Private Sub Clear_Click()
DoCmd.Close
DoCmd.OpenForm "Search Issues"
End Sub
Private Sub Search_Click()
Const cInvalidDateError As String = "You have entered an invalid date."
Dim strWhere As String
Dim strError As String
strWhere = "1=1"
' If Assigned To
If Not IsNull(Me.AssignedTo) Then
'Create Predicate
strWhere = strWhere & " AND " & "Issues.[Assigned To] = " &
Me.AssignedTo & ""
End If
' If Opened By
If Not IsNull(Me.OpenedBy) Then
'Add the predicate
strWhere = strWhere & " AND " & "Issues.[Opened By] = " &
Me.OpenedBy & ""
End If
' If Status
If Nz(Me.Status) <> "" Then
'Add it to the predicate - exact match
strWhere = strWhere & " AND " & "Issues.Status = '" & Me.Status &
"'"
' THIS IS WHERE I NEED A CODE SO, IT CAN SEARCH OTHER KEYS IN THE
SAME TABLE?
End If
In the Search form code I need it to modify code so, it look and match more
then one field. If the record is not in one field then it should go and look
for the second one or third. pl see the code. pl some one hlep me.
Thanks.
Mike
Option Compare Database
Option Explicit
Private Sub Clear_Click()
DoCmd.Close
DoCmd.OpenForm "Search Issues"
End Sub
Private Sub Search_Click()
Const cInvalidDateError As String = "You have entered an invalid date."
Dim strWhere As String
Dim strError As String
strWhere = "1=1"
' If Assigned To
If Not IsNull(Me.AssignedTo) Then
'Create Predicate
strWhere = strWhere & " AND " & "Issues.[Assigned To] = " &
Me.AssignedTo & ""
End If
' If Opened By
If Not IsNull(Me.OpenedBy) Then
'Add the predicate
strWhere = strWhere & " AND " & "Issues.[Opened By] = " &
Me.OpenedBy & ""
End If
' If Status
If Nz(Me.Status) <> "" Then
'Add it to the predicate - exact match
strWhere = strWhere & " AND " & "Issues.Status = '" & Me.Status &
"'"
' THIS IS WHERE I NEED A CODE SO, IT CAN SEARCH OTHER KEYS IN THE
SAME TABLE?
End If