访问isnull组合值

时间:2013-07-09 18:06:42

标签: vba combobox access-vba

我正在尝试检查是否为组合选择了一个值但是真正的部分(没有选择值)会抛出一个错误,指出:There is an invalid use of the . (dot) or ! operator or invalid parentheses.

If (Len(MinCombo) = 0) Then
    MsgBox "true"
Else
    MsgBox "false"
End If

我也尝试过这段代码,但是当选择一个值时它会计算为false部分:

If (IsNull(MinCombo) = True) Then
    MsgBox "true"
Else
    MsgBox "false"
End If

我正在使用MS Access Professional Plus 2010

1 个答案:

答案 0 :(得分:0)

我走了这条路:

Me.MinCombo.SetFocus
If (Me.MinCombo.selText ="") Then
  MsgBox "true"
Else
  MsgBox "false"
End If