嘿,有任何帮助将不胜感激谢谢 我有一个组合框字段=名称(txtCombo) 并且numberField =(txtNumber)
我的代码出错了,任何帮助都会受到高度赞赏。谢谢
Private Sub txtCombo_Click()
If Me.txtCombo.Value = "Meter" Then
Me.txtNumber.Value = 0
End If
End Sub
错误我的代码:
运行时错误:'2448'您无法为对象分配值,由于此代码我无法继续计算!!!
如果我选择Meter值,则必须将txtNumber更改为0
答案 0 :(得分:0)
Private Sub txtCombo_AfterUpdate()
If (Me.txtCombo.Value = "Meter") Then
Me.txtNumber.Value = "0"
End If
End Sub
如果我理解正确,如果在组合框中选择了仪表,则希望将文本框值设置为0,那么这将起作用,使用此代码并将其放入combox中的更新后事件中。