Mimadocken
Registered User.
- Local time
- Yesterday, 22:33
- Joined
- Mar 12, 2012
- Messages
- 81
I have a form with 3 textboxes on a TAB control within a form. It almost always works as expected, but every once in a while it decides I did things in the wrong order. I have attached a screen shot of the form and one of the code that is behind the bottom of the three textboxes.
The form allows entries for 3 situations. Textbox #1 allows you to enter a number of inches, which are translated into centimetres. Textbox #2 accepts a number of centimetres and returns the inches. Textbox #3 allows one to enter numbers and arithmetic symbols to use it as a small calculator. When one has entered numbers and symbols and presses Enter, the answer appears and one can continue with another part of the calculation or leave.
You should know that I'm not nearly clever enough to have come up with this code on my own. It was given to me, but unfortunately I'm unable to reach the author currently. If I understood it, maybe I could fix it on my own.
It gets uppity if I enter something in Cms and press the Tab key AND then I try to leave this tab. This can also happen if I simply click within the calculator field and then try to leave the form. It always works if I enter any number in this field before doing anything else. It then behaves like an angel.
I believe the area of my screen shot of the code was too small to include all of the longest lines of code. Therefore I'm pasting the entire line here.
Select Case MsgBox("Input '" & Me.txbCalculate & "' produced an error" & vbCr & vbCr & "Do you want to use the value as entered?", vbQuestion + vbYesNoCancel, "Input check")
You should also know that the error message I receive is "Runtime error 94. Invalid use of Null."
Here are the attachments.


Thank you for all your help, and especially for the help on this one.
The form allows entries for 3 situations. Textbox #1 allows you to enter a number of inches, which are translated into centimetres. Textbox #2 accepts a number of centimetres and returns the inches. Textbox #3 allows one to enter numbers and arithmetic symbols to use it as a small calculator. When one has entered numbers and symbols and presses Enter, the answer appears and one can continue with another part of the calculation or leave.
You should know that I'm not nearly clever enough to have come up with this code on my own. It was given to me, but unfortunately I'm unable to reach the author currently. If I understood it, maybe I could fix it on my own.
It gets uppity if I enter something in Cms and press the Tab key AND then I try to leave this tab. This can also happen if I simply click within the calculator field and then try to leave the form. It always works if I enter any number in this field before doing anything else. It then behaves like an angel.
I believe the area of my screen shot of the code was too small to include all of the longest lines of code. Therefore I'm pasting the entire line here.
Select Case MsgBox("Input '" & Me.txbCalculate & "' produced an error" & vbCr & vbCr & "Do you want to use the value as entered?", vbQuestion + vbYesNoCancel, "Input check")
You should also know that the error message I receive is "Runtime error 94. Invalid use of Null."
Here are the attachments.


Thank you for all your help, and especially for the help on this one.