Hi,
So I put together the below after I needed to defer updates on a drawing and didn't trust my colleagues to update the drawing - they actually have to read the box to get past it. It works fine, but I would like to make it so that it accepts multiple inputs (OK and Ok). I tried a few things but embarrassingly couldn't seem to get it to work.
Also if there is a better way of doing this feel free to let me know.
Do accept = InputBox("Drawing updates deferred - Do NOT Update drawing. Type ok (lower case) if you understand to continue", "Drawing Deferred", "Type here") If TypeName(accept) = "Boolean" Then Exit Sub Loop While accept <> "ok"
Cheers,
Will
Solved! Go to Solution.
Solved by will_roe. Go to Solution.
Solved by Ralf_Krieg. Go to Solution.
Hello
Can you try
Loop While accept.ToUpper <> "OK"
Sorry, tested last suggestion - doesn't work.
This one should do.
Do
accept = InputBox("Drawing updates deferred - Do NOT Update drawing. Type ok (lower case) if you understand to continue", "Drawing Deferred", "Type here").ToUpper
If accept="" Then Exit Sub 'empty string in input field OR CANCEL BUTTON PRESSED
If TypeName(accept) = "Boolean" Then Exit Sub
Loop While accept <> "OK"
Here's another idea. You don't have to worry about spelling, capitalization, Cancel, or Esc key use this way. They must deal with it by choosing one of the available options, before it will let the user move on.
Dim oOptions As New List(Of String)
oOptions.AddRange({"OK", "CANCEL" })
ReShow :
oAns = InputListBox("Drawing updates deferred - Do NOT Update drawing.", oOptions,"","Drawing Deferred")
If oAns = "" Then
GoTo ReShow 'so they can't get out of dealing with it, and shoosing an answer.
End If
If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click (LIKE or KUDOS) 👍.
If you want and have time, I would appreciate your Vote(s) for My IDEAS :light_bulb:or you can Explore My CONTRIBUTIONS
Wesley Crihfield
(Not an Autodesk Employee)
Thanks,
I'm not sure how I missed originally but you can just press the x and the box goes away. Any idea how to stop this?
edit:
Sorted it -
Do accept = InputBox("Drawing updates defered - Do NOT Update drawing. Type ok (lower case) if you understand to continue - WR and JF", "Drawing Defered", "Type here") acceptupper = accept.ToUpper If TypeName(accept) = "Boolean" Then Exit Sub Loop While acceptupper <> "OK"
Can't find what you're looking for? Ask the community or share your knowledge.