pl hlep me to correct this code

M

Mike Saifie

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 &
"'"End If


' THIS IS WHERE I NEED A CODE SO, IT CAN SEARCH OTHER KEYS IN THE
SAME TABLE? I have the field in issue table call key word 1 and keyword 2
etc as well, if the record is not there then it should lookinto other fields
and deliever the record set.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top