pl hele me to fix this code any help is much needed

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.
 
B

Brian Bastl

Mike,

copied from mvps.org:

Multiposting is bad!
1.. You commit the crime of multi-posting your questions by posting the
same question to several different newsgroups, one at a time.

2.. Several folks who could answer your questions take this as a serious
misuse of newsgroups and will likely ignore your questions.

******************

Brian
 
M

Mike Saifie

sorry Brain,

any way can you help me with the code pl.

pl


Brian Bastl said:
Mike,

copied from mvps.org:

Multiposting is bad!
1.. You commit the crime of multi-posting your questions by posting the
same question to several different newsgroups, one at a time.

2.. Several folks who could answer your questions take this as a serious
misuse of newsgroups and will likely ignore your questions.

******************

Brian


Mike Saifie said:
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.
 
B

Brian Bastl

Mike,

I believe that someone else has already responded to one of your posts in
another group. This is why multi-posting is so problematic, both for you and
the person trying to help you.

Look for your post in ...FormsCoding ng.

Brian


Mike Saifie said:
sorry Brain,

any way can you help me with the code pl.

pl


Brian Bastl said:
Mike,

copied from mvps.org:

Multiposting is bad!
1.. You commit the crime of multi-posting your questions by posting the
same question to several different newsgroups, one at a time.

2.. Several folks who could answer your questions take this as a serious
misuse of newsgroups and will likely ignore your questions.

******************

Brian


Mike Saifie said:
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
keyword
 

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