Script in querysave vs. formula string

I’m a newbie creating an accident report database. I have a submit new report button with this formula string:@Command([FileSave]);

@MailSend( bunch of code );

@Prompt([Ok];“Thank You”;“This report has been submitted”);

@Command([FileCloseWindow])

My form’s querysave (lotusscript below)validates a bunch of fields. If the the validation determines there are empty fields, it gives a nice “you missed some” message, but comes back to the formula and emails people a new report has been followed. I want it to not continue through the @MailSend(~) formula. How do I make it quit? I’m new! Be real explicit! Thanks

Querysave (portion of code)-

t_Name = uidoc.FieldGetText(“Name”)

If t_Name = "" Then

	errorlist = "1. Name of Injured Person"

End If



t_Date = uidoc.FieldGetText("Date")

If t_Date = "" Then

	errorlist = errorlist + Chr(13) + "2. Date of Accident"

End If

'et cetera

If errorlist = “” Then

	Call uidoc.FieldSetText("close","0")

	continue = True

Else

	Messagebox "The following block(s) are missing information or contain an incorrect type of data:" +Chr(13) + errorlist

	ContinueSave = "No"

	ShouldExit = "Yes"

	continue = False

	Exit Sub

End If

Subject: RE: script in querysave vs. formula string

@If(@Command([FileSave]);@Do(

@MailSend( bunch of code );

@Prompt([Ok];“Thank You”;“This report has been submitted”);

@Command([FileCloseWindow])

);

“”)

Subject: I tend to prefer…

something like this. Does the same I just think it reads easier:

@If(@Command([FileSave]); “”; @Return(“”));

@MailSend

@Prompt

@Command([FileCloseWindow]);

Subject: RE: I tend to prefer…

Both answers make sense to me and I’ll test today. So the @Command([FileSave]) inside the @If returns a true or false based on success?

Subject: Yep