×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

NXInputBox

NXInputBox

NXInputBox

(OP)
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

RE: NXInputBox

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)

RE: NXInputBox

(OP)
JXB0809,

Thank You!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources