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.
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: 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?