Obtaining textbox value in change event handler

前端 未结 6 785
攒了一身酷
攒了一身酷 2021-01-13 04:10

I\'ve written a form that performs queries asynchronously as text is typed into a textbox, however I somewhat arbitrarily seem to get the following error th

6条回答
  •  佛祖请我去吃肉
    2021-01-13 04:42

    To set or return a control's Text property, the control must have the focus, or an error occurs.
    To move the focus to a control, you can use txtBox.SetFocus or DoCmd.GoToControl "txtBox".

    Also, the Text property is not always available:
    While the control has the focus, the Text property contains the text data currently in the control; the Value property contains the last saved data for the control. When you move the focus to another control, the control's data is updated, and the Value property is set to this new value. The Text property setting is then unavailable until the control gets the focus again.

提交回复
热议问题