MSAccess - populate text box with value from query

前端 未结 2 1846
太阳男子
太阳男子 2021-01-27 06:37

I have a combo box and several text boxes on a form. When I select a value from the combo box I want it to run a query based on that value and populate the text boxes with the d

2条回答
  •  南笙
    南笙 (楼主)
    2021-01-27 07:21

    There is no need to do this:

    Me.Text51.SetFocus
    Me.Text51.Text = location
    

    it is true that the text property is only available when the control has the focus, but the value property is available without any focus, or Access VBA is quite happy with just the name of the control:

    Me.Text51.Value = location
    

    Or

    Me.Text51 = location
    

提交回复
热议问题