K
KC_Cheer_Coach
I am working in Access 2007 and have a search form with multiple fields on
it. The search function works on all the fields except for a few. There are
some check boxes that are not returning any records to the subform. The
subform opens, blinks, and shows 0 rows. I need the code written to show that
when a box is checked and a certain "text" field or "number" field have
anything at all in them, then those rows will be returned. For instance, if
the SDSubmitted box is checked, then I want all rows where number field
ServiceDesk has information in it. And, if the IDTSubmitted box is checked,
then I want all rows where text field IDTNumber has information in it. I have
been working on this for a while and can't get it right.
frmSearch is the search form including frmIssuesSubform which returns data
from the main table tblIssues.
The code that I have borrowed from an Access template and have been working
on is this:
' If SD Submitted
If Nz(Me.SDSubmitted) <> "" Then
strWhere = strWhere & " AND " & "tblIssues.ServiceDesk Like '*" &
Me.SDSubmitted & "*'"
End If
' If IDT Submitted
If Nz(Me.IDTSubmitted) <> "" Then
strWhere = strWhere & " AND " & "tblIssues.IDTNumber Like '*" &
Me.IDTSubmitted & "*'"
End If
Can someone help me? With the way it is written, it will return everything I
want IF the text and number fields described above were originally
checkboxes.
it. The search function works on all the fields except for a few. There are
some check boxes that are not returning any records to the subform. The
subform opens, blinks, and shows 0 rows. I need the code written to show that
when a box is checked and a certain "text" field or "number" field have
anything at all in them, then those rows will be returned. For instance, if
the SDSubmitted box is checked, then I want all rows where number field
ServiceDesk has information in it. And, if the IDTSubmitted box is checked,
then I want all rows where text field IDTNumber has information in it. I have
been working on this for a while and can't get it right.
frmSearch is the search form including frmIssuesSubform which returns data
from the main table tblIssues.
The code that I have borrowed from an Access template and have been working
on is this:
' If SD Submitted
If Nz(Me.SDSubmitted) <> "" Then
strWhere = strWhere & " AND " & "tblIssues.ServiceDesk Like '*" &
Me.SDSubmitted & "*'"
End If
' If IDT Submitted
If Nz(Me.IDTSubmitted) <> "" Then
strWhere = strWhere & " AND " & "tblIssues.IDTNumber Like '*" &
Me.IDTSubmitted & "*'"
End If
Can someone help me? With the way it is written, it will return everything I
want IF the text and number fields described above were originally
checkboxes.