garland29
asked on
If NotNull then...
I have simple search for where the user checks a check box next to the criteria that they would like to filter by. But I was wonder if there was a way to remove the check box. I have tried If Not IsNull but it does not work. Here is the code that I use.
If chkLegal = True Then
If Nz(Forms![frm_Customer_Sea rch]!txtLe galName, "") <> "" Then
strWhere = "(Legal_Name LIKE '*" & Replace(Forms![frm_Custome r_Search]!
txtLegalName, "'", "''") & "*') AND "
End If
End If
If chkLegal = True Then
If Nz(Forms![frm_Customer_Sea
strWhere = "(Legal_Name LIKE '*" & Replace(Forms![frm_Custome
txtLegalName, "'", "''") & "*') AND "
End If
End If
And the where clause seems to be incomplete.
You get something like this:
strWhere = "(Legal_name Like '*yourvalue*') AND"
You get something like this:
strWhere = "(Legal_name Like '*yourvalue*') AND"
ASKER
Yes I would like to remove the check box. But there are about 8 text boxes with different criteria. I would like it to check if there is anything in the text box if not then move on.
G-
G-
so you'd want to filter on a criteria if and only if the criteria is not empty ?
len(txtLegalName)
returns the length of the txtLegalName field.
if len(txtLegalName) > 0 then
....
end if
or you could use IsEmpty( ), IsNull( ), IsNumeric( ) etc
len(txtLegalName)
returns the length of the txtLegalName field.
if len(txtLegalName) > 0 then
....
end if
or you could use IsEmpty( ), IsNull( ), IsNumeric( ) etc
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I love the ones that are staring right back at me;-) Thanks!!!
Not quite sure what your asking here. Are you saying you'd like to remove the check box (chkLegal) and just use the txtLegalName control?
Jim.