Notesuidoc not save

dear friends,i have a button named “completed”

in completed button if i click then it check the field1 button.

here is my code

sub click()

dim uidoc as notesuidocument

uidoc.save()

end sub

--------in sub querysave-------------

sub querysave(source as notesuidocument)

dim doc as notesdocument

set doc = source.document

if doc.field1 = “” then

msgbox “you must type a letter”

source.gotofield(“field1”)

sub exit

end if

end sub

but if i run in notesclient, then it appears messagebox “NOTESUIDOC NOT SAVE” after msgbox “you must type a letter”.

my trouble is : i want the messagebox “NOTESUIDOC NOT SAVE” doesn’t appear

thanx for answering my question

Subject: notesuidoc not save

You haven’t set your NotesUIDocument object in your button – the UI document doesn’t come free in the box:

Sub Click (Source As Button)

Dim ws As New NotesUIWorkspace

Dim uidoc As NotesUIDocument

Dim success As Variant

Set uidoc = ws.CurrentDocument

success = uidoc.Save

End Sub

Your button won’t save the document, the message is likely coming from an attempt to close the window. Of course, if that is all you’re doing, a Formula Language button would be a better option:

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

Subject: RE: notesuidoc not save

if i use @If(@Command([FileSave]); @Command([FileCloseWindow]);then the windows will close before executing next field.

i have field2 too

thanx for answering my question

Subject: RE: notesuidoc not save

Then don’t use @command([FileCloseWindow]). Why are you saving the document if you aren’t finished making changes?