E enonod Well-Known Member Licensed User Longtime User Apr 11, 2013 #1 I have received the following runtime exception message from the code shown but cannot find a list of errors. Can somebody please suggest the cause of this error. Code: Copy Sub keys_Click) Dim snd As Label Dim tmp As String Dim bShift As Boolean snd=Sender tmp=snd.text Select tmp 'This is the exception line and tmp =Shift presumably "Shift" Case "Shift" bShift= Not (bShift) ... End Select End Sub Last edited: Apr 11, 2013
I have received the following runtime exception message from the code shown but cannot find a list of errors. Can somebody please suggest the cause of this error. Code: Copy Sub keys_Click) Dim snd As Label Dim tmp As String Dim bShift As Boolean snd=Sender tmp=snd.text Select tmp 'This is the exception line and tmp =Shift presumably "Shift" Case "Shift" bShift= Not (bShift) ... End Select End Sub
klaus Expert Licensed User Longtime User Apr 11, 2013 #2 What did you set in the Tag ? Best regards. Upvote 0
E enonod Well-Known Member Licensed User Longtime User Apr 11, 2013 #3 Thank you for responding. You have me baffled. I was using the Tag for a Upper Case version of the text on the label. However I have removed all reference to Tag and no longer use that. I have scoured my code and cannot find any lingering reference. The program runs from scratch each time and so nothing should linger. Perhaps you could tell me the reason for your question, especially as I had been using Tag. I suspect I am supposed to have had a Eureka moment but I didn't. Upvote 0
Thank you for responding. You have me baffled. I was using the Tag for a Upper Case version of the text on the label. However I have removed all reference to Tag and no longer use that. I have scoured my code and cannot find any lingering reference. The program runs from scratch each time and so nothing should linger. Perhaps you could tell me the reason for your question, especially as I had been using Tag. I suspect I am supposed to have had a Eureka moment but I didn't.
agraham Expert Licensed User Longtime User Apr 11, 2013 #4 The problem may lay in the other "Case" statements that you have omitted as the "Select" statement processes those values. Upvote 0
The problem may lay in the other "Case" statements that you have omitted as the "Select" statement processes those values.
E enonod Well-Known Member Licensed User Longtime User Apr 11, 2013 #5 Thank you for that response. You are correct because commenting out the others removes the problem. I can now investigate further. However I was caught by where the error occurred (on the Select itself) and did not account for it being common to all case's and made the erroneous assumption that it was the one following. If I cannot find it myself I will come back for more advice. [Edit]The final Case is Case "Enter" AND etName.Text<>"" may I assume I cannot do that? Of course I can't, how stupid! Last edited: Apr 11, 2013 Upvote 0
Thank you for that response. You are correct because commenting out the others removes the problem. I can now investigate further. However I was caught by where the error occurred (on the Select itself) and did not account for it being common to all case's and made the erroneous assumption that it was the one following. If I cannot find it myself I will come back for more advice. [Edit]The final Case is Case "Enter" AND etName.Text<>"" may I assume I cannot do that? Of course I can't, how stupid!