Hello Kevin,
No code should follow an @Exit.
Your command buttons code will be something like
Var vSuccess as Int
Var vMenu as Int
SetDefaultTab("Search/Update Non-Conformances")
GlobalValue("KeyValue", @str(NC?))
@Save
vSuccess = @SelectTreeItem("Search Update Menu!Search (F7)")
vMenu = @SelectTreeItem("ESGAGE!Forms!Search/Update!Orders!Non-Conformance Report")
Your Non-Conformance Report on Retrieve Spec open programming is going to be something like
Var vSuccess as Int
Var vMenu as Int
Var vKey as Int
If @GlobalValue("KeyValue") <> "" Then
{
vKey = @ToNumber(@GlobalValue("KeyValue"))
GlobalValue("KeyValue", "")
NC? = vKey
vSuccess = @SelectTreeItem("Search Menu!Search Commands!Retrieve New Results (F10)")
vSuccess = @SelectTreeItem("Search Update Menu!Results Commands!Printing Commands!Print Forms")
vSuccess = @SelectTreeItem("Search Update Menu!Search (F7)")
vMenu = @SelectTreeItem("ESGAGE!Forms!Search/Update!Orders!Non-Conformances")
FormFieldValue("Non-Conformances:(Search)", "NC?", 0, vKey)
VSuccess = @SelectTreeItem("Search Menu!Search Commands!Retrieve New Results (F10)")
@Exit
}
In some other event you are going to need to clear the default tab or set it back to your custom menu if you are using one. The code above assumes that you are in Update mode on the "Non-Conformances" form and that the form "Non-Conformance Report" is not open.
For future reference do not name elements, forms, or databases with a - in the name. A list of characters that should not appear in names are on page 7 of the Q&A Database Translation Guide.
-Ray