Continue = False not working in Querysave

I am doing some field validation in Querysave. I am able to catch the errors with no problem and I flag the user with a Messagebox. The problem is the file then closes even though I have a Continue = False. I finally stripped out everything and copied in the code from a Notes Help example for Querysave changing only the field name to one of mine. Here is the code;

Sub Querysave(Source As Notesuidocument, Continue As Variant)

If ( source.FieldGetText( “MiddleInitial” ) = “” ) Then

Messagebox( "You must enter a Middle Initial." )

Call source.GotoField( "MiddleInitial" )

Continue = False

End If

End Sub

When the code runs and I click save with a blank MiddleInitial field I get the Messagebox then the file closes. Shouldn’t it remain open so the user can fill in the field?

Subject: Continue = False not working in Querysave

I’ve run into similar problems where pieces of code simply don’t work…completely closing out of Notes, Designer, and/or administrator and logging back in seem to aleviate the problem.

Good Luck

Subject: RE: Continue = False not working in Querysave

Thanks for the response. I just closed out of Notes, Notes Designer, and Notes Help and went back in. It still doesn’t work. I know what you mean though. I’ve had that happen before myself.

Subject: You probably have a button…

with:@Command([FileSave]);

@Command([FileCloseWindow])

what you should really have is:

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

Subject: RE: You probably have a button…

Bill, You were right! I didn’t see your post before I sent in my last one. Thanks a bunch for your help.

Subject: That is why I wanted to see his button:-)

Subject: Continue = False not working in Querysave

A little more information on my problem in case it matters. The database is Type: Domino Directory and is based on the Notes Address Book Template. The document I have open and want to validate upon saving is a Person record.

Subject: RE: Continue = False not working in Querysave

Tried it on a copy of my public nab with 6.0.2 CF2 and it works fine. Really wierd - maybe some corruption? Have you tried a new form with just that field? Or that form in a new db?

hth

Tony

Subject: RE: Continue = False not working in Querysave

I found it! Stupid me. The Save and Close action code had the following in it;

@PostedCommand([FileSave]);@PostedCommand([FileCloseWindow])

Once Querysave finished, the FileCloseWindow command still executed regardless of the Continue = False. Guess I’m ready for the weekend.

Subject: Continue = False not working in Querysave

Please post the code that saves the document. Chances are the code problem is there.