What callback are you in and what EVENT are you trapping when you call GetCtrlVal()?
Here are some of the problems trapping the Enter key in the callback for a numeric control.
EVENT_KEYPRESS happens before EVENT_VAL_CHANGED which happens before EVENT_COMMIT.
If the number isn't changed and enter is pressed, only KEYPRESS is generated, no COMMIT.
When KEYPRESS traps Enter, the control value hasn't been updated yet.
Instead of trying to trap the Enter key in the callback to the numeric control, try something like this.
1. Place a command button (e.g. labeled ENTER or OK) on your user interface.
2. In the callback for the command button under EVENT_COMMIT, call GetCtrlVal() on the numeric and process it.
3. Make the Enter the shortcut key for the command button.
In the UI editor window, double-click on the command button. In the Shortcit Key section, leave the Modifier Key set to None and set the Key to Enter.
4. If you want, in the callback for the command button, call SetActiveCtrl() to give the focus back to the numeric.
5. You can even hide the command button if you don't want it to be displayed on your user interface. In the UI editor window, double-click on the numeric control. In the section labeled Control Settings, select Initially Hidden.