View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_3_] Bob Phillips[_3_] is offline
external usenet poster
 
Posts: 2,420
Default TextBox Event Error

Because you are trying to use a control like a variable

Private Sub TextBox1_Change()
i = 1
MsgBox Me.Controls("TextBox" & i).Value
End Sub


--
__________________________________
HTH

Bob

"Stephen Newman" wrote in message
...
Could somebody explain why this throws an error please?

Private Sub TextBox1_Change()
i = 1
MsgBox TextBox & i & .Value
End Sub

I get this error at .Value:

Compile error:
Invalid or unqualified reference.

If posible, could the correct syntax for writing this be provided?