IF NOT seek(alltrim(mpatlastname), ALIAS(), "last_name") do form pat_add &&do form notfindapppatient thisform.release() ENDIF>>Correct your SEEK to use existing index tag.
thisform.refresh >do case > case .not. isblank(mpatlastname) > seek alltrim(mpatlastname) order tag last_name of patient.cdx > if not found() and eof() > do form pat_add &&do form notfindapppatient > thisform.release() > endif > case mservpatphone <> 0 > seek (mservpatphone) order tag phone of patient.cdx > if not found() and eof() > do form pat_add &&do form notfindapppatient > thisform.release() > endif > case mhlth_card <> 0 > seek (mhlth_card) order tag health_num of patient.cdx > if not found() and eof() > do form pat_add &&do form notfindapppatient > thisform.release() > endif >ENDCASE>