Vb script right click and escape key help

In the attached Vb script I notice that if the user presses escape my script works but if they right click then my script doesn’t supply the needed name.
Thanks for any tips on this or ways to make it better.

setCustomUnits003.rvb (804 Bytes)

hi Roland,

please try this one:
setCustomUnits004.rvb (752 Bytes)

I have changed:
If IsNull(customUnitName) Then
If IsNull(customUnitName) Or customUnitName = "" Then

since RMB click feeds empty string to the method and not Null. Now it should pass “Custom Units” in any of the two scenarios. Does it work ?


Hi @Jarek ,
Yep that’s it!
I knew it was a logic thing with the empty string not being null, thanks for the clarification and tip on how to get around that.