Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

NXInputBox

Status
Not open for further replies.

kr7530

Automotive
Aug 9, 2011
130
I am trying to add some code to my journal that would exit the sub when the user presses "Cancel".
Below is the code, it won't get past the inputbox line when the "Cancel" button is pressed so I can't check the value.

'----------USER INPUTS---------------------------------------------------------------------------------------
Dim UserInputNumber As Double
Dim JobNumber As String
UserInputNumber = NXInputBox.GetInputNumber("Enter a 5 Digit Job Number", "Jobnumber","")

If UserInputNumber.ToString = "" Then
'user pressed cancel
Exit Sub
End If

JobNumber = UserInputNumber
'-------------------------------------------------------------------------------------------------------------

Thanks,
Kevin
NX8 Windows7
 
Replies continue below

Recommended for you

Dim answer As String = ""
Dim iuserentry As Integer
Do
Dim prompt As String = "Enter a 5 Digit Job Number"
Dim title As String = "Jobnumber"
Dim defaultvalue As String = ""
answer = NXInputBox.GetInputString(prompt, title,defaultvalue)
'if cancel is pressed, exit sub
If answer = "" Then Exit Sub
Loop Until Integer.TryParse(answer, iuserentry)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor