Hi All, I'm using Infopath '03. I'm trying to disable my Save and Save As commands, when a field named "Current_Status" equals "Review Complete" using VBScript.
Here is my code so far...
Sub XDocument_OnSaveRequest(eventObj)
If XDocument.DOM.selectSingleNode("my:myFields/my:Current_Status").Text = "Review Complete" Then
XDocument.UI.Alert("Sorry you can't save this document as it is read-only!")
eventObj.ReturnStatus = False
Exit Sub
Else
eventObj.IsCancelled = eventObj.PerformSaveOperation
eventObj.ReturnStatus = True
End If
End Sub
When i test it my alert box comes up fine, but then another alert box follows which states "Infopath cannot save this form. The OnSaveRequest handler returned a value indicating that the save failed". Can i change my code to get rid of this alert???
Hopefully that made sense, you'll have to excuse me I'm quite new to Infopath. Cheers