Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations JAE 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
Joined
Aug 9, 2011
Messages
130
Location
US
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
 
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)
 
JXB0809,

Thank You!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top