Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/vba/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ms access 在MS Access中启用VBA文本和组合框_Ms Access_Vba - Fatal编程技术网

Ms access 在MS Access中启用VBA文本和组合框

Ms access 在MS Access中启用VBA文本和组合框,ms-access,vba,Ms Access,Vba,我想在另一个组合框(Combo26)的值为“Resolved”时启用一个文本框(下文为Text28)和一个组合框(下文为combo43) 这是用VBA编写的代码,应该做到: Private Sub Combo26_AfterUpdate() If Combo26.Value = "Resolved" Then Me.Text28.Enabled = True Me.Combo43.Enabled = True Else Me.Text28.Enabled = F

我想在另一个组合框(Combo26)的值为“Resolved”时启用一个文本框(下文为Text28)和一个组合框(下文为combo43)

这是用VBA编写的代码,应该做到:

    Private Sub Combo26_AfterUpdate()

If Combo26.Value = "Resolved" Then
    Me.Text28.Enabled = True
    Me.Combo43.Enabled = True
Else
    Me.Text28.Enabled = False
    Me.Combo43.Enabled = False

End If

End Sub
不幸的是,当我尝试它时,什么都没有发生。你有什么想法吗?
Thx

如果您将两列作为行源(如上面的注释所示),则显示的第一列似乎是ID。您应该将第二列作为比较的目标,例如

If Combo26.Column(1) = "Resolved" Then
  ...
那对我有用

Combo26.Column(0)

将为您提供ID。

请将行源发布到Combo26@DataWriter从StatusList中选择[StatusList].[ID],[StatusList].[Status];--在子项中放置断点并检查
Combo26.Value
-它将是一个ID,而不是您期望的字符串。@Andre我如何检查Combo26.Value或Combo26.Column(0)?thxWith
Debug.Print