** Set the parameters and update the view cProdName = "Widgets" cQuality = "Good" sele v_MyView requery() ** Now you have the view with the correct parameters, so you check it to see if there are any records if _tally = 0 =Messagebox("No Records Found", 16, "Report") else Report Form MyReport Preview endifFinally, if you are putting code in the INIT() method of a form or report and you don't want to run it (as when there are no records) you add a RETURN .F. to your code:
If _tally = 0
=Messagebox("No Records Found", 16, "Report")
return .F.
** Report has now exited back to the calling program.
endif
HTH
Barbara
>Hello Barbara,
>
> Thank you so very very much for your help.
> Like you assumed, it's a parameterized view with parameters for Product Name and Quality fields. Let me tell you about what I did after reading your second mail.
> I tried to go to DataEnvironment of the report, then Cursor's Properties, and I put the code that Dave suggested in the "Init" Method. The report works fine but seems slower than before. And another thing here is if there is no record to be returned, I got the notice message(what I desire), click "Ok"(on the messagebox) to get out, the report flashs very fast. Do you think that all of those "symptoms" are "normal"? Did I do the coding in the right place, the right way? How about the _tally method? Will it give the same result?
> Once, I am looking forward hearing from you. God bless you.
> Diane.
>Barbara Paltiel, Paltiel Inc.