G
Guest
I created a query where the user can type in the firs couple of letters of
the name (or phone or clientID) and the underlying subform/query will be
filtered based on the query. The problem is that if the client does not have
a value in one of the fields (first name and home phone are not manditory)
entered they don't show on the query. I tried to offer Null & "" values but
if the client is missing a phone number they are still excluded from the
query. Can anyone help?
SELECT Main.ClientID, Main.[Last Name], Main.[First Name], Main.[Home
Phone], Main.Address, Main.City
FROM Main
WHERE (((Main.ClientID) Like [forms].[Frm_findClient].[ClientID] & "*") AND
((Main.[Last Name]) Like [forms].[Frm_findClient].[LastName] & "*") AND
((Main.[First Name]) Like [forms].[Frm_findClient].[FirstName] & "*" Or
(Main.[First Name]) Like "IsNull" Or (Main.[First Name]) Like "") AND
((Main.[Home Phone]) Like [forms].[Frm_findClient].[HomePhone] & "*" Or
(Main.[Home Phone]) Like "IsNull" Or (Main.[Home Phone]) Like ""));
the name (or phone or clientID) and the underlying subform/query will be
filtered based on the query. The problem is that if the client does not have
a value in one of the fields (first name and home phone are not manditory)
entered they don't show on the query. I tried to offer Null & "" values but
if the client is missing a phone number they are still excluded from the
query. Can anyone help?
SELECT Main.ClientID, Main.[Last Name], Main.[First Name], Main.[Home
Phone], Main.Address, Main.City
FROM Main
WHERE (((Main.ClientID) Like [forms].[Frm_findClient].[ClientID] & "*") AND
((Main.[Last Name]) Like [forms].[Frm_findClient].[LastName] & "*") AND
((Main.[First Name]) Like [forms].[Frm_findClient].[FirstName] & "*" Or
(Main.[First Name]) Like "IsNull" Or (Main.[First Name]) Like "") AND
((Main.[Home Phone]) Like [forms].[Frm_findClient].[HomePhone] & "*" Or
(Main.[Home Phone]) Like "IsNull" Or (Main.[Home Phone]) Like ""));