| | |
|
|
|
Accessing text box value |
| message from John on 22 May 2004 |
Hi
I am trying to access the value of a textbox in its 'on change' event as
follows;
msgbox Me.Company.Text
But I am getting the error 'You can't reference a property or method for a
control unless the control has the focus.'.
How can I get the current text in the textbox as the user types each
character?
Thanks
Regards
|
| Allen Browne replied to John on 22 May 2004 |
Unlike pure VB, you do not need the ".Text" bit in Access.
MsgBox Me.Company
That's the equivalent of:
MsgBox Me.Company.Value
The Text property applies only to the text string that is in the text box
while it has focus, and before it has been validated and assigned to the
Value property. For example, when you are entering a date but have not yet
entered the year, the Text may be:
05/22/
However, that could never become the Value as it is not a valid date.
|
|
Archived message: Accessing text box value (MS Access Error Message)