

i have two fields for query to lookup, firstname and lastname.
THE FIRSTNAME FIELD:
IIf(IsNull([Forms]![frmSearch]![FirstName]),"",[Forms]![frmSearch]![FirstName])
THE LASTNAME FIELD:
IIf(IsNull([Forms]![frmSearch]![LastName]),"",[Forms]![frmSearch]![LastName])
Intended operation;
1) The value is seen on my search form (frmsearch) and returned to FIRSTNAME and LASTNAME query fields as NULL or VALUE.
2) If on the search form FIRSTNAME has value and LASTNAME is NULL then query should lookup a record with valid FIRSTNAME and nothing in LASTNAME.
3) If on the search form LASTNAME has value and FIRSTNAME is NULL then query should lookup a record with valid LASTNAME and nothing in FIRSTNAME.
4) If on the search form FIRSTNAME and LASTNAME have value (NOT NULL) then lookup record with valid FIRSTNAME and LASTNAME.
5) If no information is entered on the search form then "enter some information" as message box.
6) I would want wildcard using which also doesn't seem to work in IIF statement. e.g. "*" & [Forms]![frmSearch]![FirstName] & "*"
THERE FORE ---> IIf(IsNull("*" & [Forms]![frmSearch]![FirstName] & "*"),"","*" & [Forms]![frmSearch]![FirstName] & "*")
ONLY NUMBERS ABOVE (2) (3) AND (6) DO NOT WORK, IF ANYONE COULD GIVE SOME LIGHT ON THIS I WOULD BE VERY GRATEFUL, AS I AM IN THE BLUE ON THIS.

TAKE IT EASY
