FoxStudent
Technical User
How do I set up the scan condition in such a way that if I do not enter all search fields, that it will still find matching records for the fields I have entered.<br>I have tried to do it through iif function but it keeps saying missing expression.<br>Please Help;<br> Grainne Evans<br><br>scan for upper(alltrim(framenum)) = upper(alltrim(m.framenum)) .and. upper(alltrim(engnum)) = upper(alltrim(m.engnum)) .and. upper(alltrim(parttype)) = upper(alltrim(m.parttype)) .and. upper(alltrim(manufact)) = upper(alltrim(m.manufact)) .and. upper(alltrim(specific)) = upper(alltrim(m.specific)) .and. upper(alltrim(model)) = upper(alltrim(m.model)) .and. upper(alltrim(year)) = upper(alltrim(m.year)) .and. upper(alltrim(engsize)) = upper(alltrim(m.engsize))<br>*scan for iif(empty(m.framenum),,upper(alltrim(framenum)) = upper(alltrim(m.framenum))) .and. iif(empty(m.framenum),,upper(alltrim(engnum)) = upper(alltrim(m.engnum))) .and. iif(empty(m.parttype),,upper(alltrim(parttype)) = upper(alltrim(m.parttype))) .and. iif(empty(m.manufact),,upper(alltrim(manufact)) = upper(alltrim(m.manufact))) .and. iif(empty(m.specific),,upper(alltrim(specific)) = upper(alltrim(m.specific))) .and. iif(empty(model),,upper(alltrim(model)) = upper(alltrim(m.model))) .and. iif(empty(m.year),,upper(alltrim(upper(year)) = upper(alltrim(m.year))) .and. iif(empty(m.engsize),,upper(alltrim(engsize)) = upper(alltrim(m.engsize)))<br> *If the record is not marked for deletion and has a current stock level<br> *of 0<br> if upper(status) = "D" .and. curlevel = 0<br> *The part will never be available for purchasing<br> else<br> @2,31 say "Matching Part Records" &&Display title<br> store .t. to m.validmat<br> clear<br> *Display details about the part<br> @6,6 say "Code"<br> @6,19 say partcode<br> @8,6 say "Description"<br> @8,19 say descrip<br> @10,6 say "Manufacturer"<br> @10,19 say manufact<br> @8,38 say "Specific"<br> @8,57 say specific<br> @10,38 say "Unit Selling Price"<br> @10,57 say price function "$"<br> store "" to m.response<br> define window corrpart from 20,26 to 24,56 title 'Is this the correct part?'<br> activate window corrpart<br> =clearead()<br> @1,12.5 get m.response picture '@*h Yes;No'<br> read<br> release window corrpart<br> *close data<br> store "" to m.howsear<br> if m.response = "No"<br> define window howsear from 20,16.5 to 24,60.5 title "Continue searching or perform new search?"<br> activate window howsear<br> =clearead()<br> @1,4.5 get m.howsear picture '@*h Continue;New Search'<br> read<br> release window howsear<br> *close data<br> if m.howsear = "New Search"<br> *The search for matching part records is quit<br> *and the user is returned to the new sales<br> *form to be re-prompted for a part code <br> set directory to (datapath)<br> use parts<br> locate for partcode = 0<br> store .t. to m.finished<br> endif<br> else<br> *The search for matching part records is quit and the<br> *user is returned to the new sales form. The part code<br> *of the selected record is saved and the user is<br> *re-prompted for a part code<br> store partcode to m.spartcod<br> set directory to (datapath)<br> use parts<br> locate for partcode = 0<br> store .t. to m.finished<br> endif<br> endif<br>