Distinction between using .text and .value in VBA Access

后端 未结 5 1677
悲哀的现实
悲哀的现实 2020-11-27 07:59

I am passing the textbox1.text values into a query and sometimes into a string:

Dim combor1 As String
combor1 = comboReason1.Text
5条回答
  •  我在风中等你
    2020-11-27 08:47

    You can use the Text property to set or return the text contained in a text box or in the text box portion of a combo box.

    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 the SetFocus method or GoToControl action.

    You can use the Value property to determine or specify if a control is selected, the selected value or option within the control, the text contained in a text box control, or the value of a custom property.

    The Value property returns or sets a control's default property, which is the property that is assumed when you don't explicitly specify a property name. In the following example, because the default value of the text box is the value of the Text property, you can refer to its Text property setting without explicitly specifying the name of the property.

    Forms!frmCustomers!txtLastName = "Smith"
    

    Text Property Reference
    http://msdn.microsoft.com/en-us/library/aa173453.aspx

    Value Property Reference
    http://msdn.microsoft.com/en-us/library/aa173476.aspx

提交回复
热议问题