By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,124 Members | 1,746 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,124 IT Pros & Developers. It's quick & easy.

Accessing text box value

P: n/a
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
Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
John wrote:
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


Are you sure that Company is the name of the text box, and that it does
in fact have the focus? You can look up ActiveControl in Help to find
out how to determine which control has focus.

The problem could also be that when the MsgBox is displayed the text box
doesn't have the focus. If you save Me.Company.Text to a string variable
and display that, you might have better luck.

Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.