Sorry if this is a double post, I am having email problems...
I am trying to improve a search form I made over 10 years ago to help users
search for customers using several different columns. Users kept asking how do
I find a customer when we can’t remember their name or account number but
remember they worked at ABC company, was a male and lived in XYZ town.
So I created a form with several Var Edit fields, Firstname, Lastname, HmPhone,
WkPhone and so on. I even had columns for Balance, and LastTransaction. With
these 2 fields they could choose < > =. The user would fill out 2 or 3 of the
fields then click a button that would run an EEP like below.
Not real slick but it seems to work OK.
I am sure this could be improved on and would love to have any suggestions.
Thanks
Marc
IF vfirst IS NOT NULL THEN
SET VAR vfirst = (' and f_name like '''+ ( .vfirst)+'%'+'''')
ENDIF
IF vlast IS NOT NULL THEN
SET VAR vlast = (' and L_name like '''+ ( .vlast)+'%'+'''')
ENDIF
IF vhmphone IS NOT NULL THEN
SET VAR vhmphone = (' and hm_phone contains '''+ ( .vhmphone)+ +
'''')
ENDIF
IF vwkphone IS NOT NULL THEN
SET VAR vwkphone = (' and wk_phone contains '''+ ( .vwkphone)+ +
'''')
ENDIF
-- we have an IF ENDIF statement each field
SET VAR vwhere = +
('custnum exists ' + .vfirst + .vlast + .vhmphone + .vwkphone ...........
BROWSE custnum=NOSCROLL=READ=7 AS patnum,f_name=NOSCROLL=11 +
AS firstname,l_name=NOSCROLL=11 AS lastname, ........
FROM ptinfo +
WHERE &vwhere OPTION LOCK 3