Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果单击提交按钮cbo_moduleName后该字段为空但没有任何反应,我将尝试返回错误消息。
cbo_moduleName
Private Sub btnSubmit_Click() If IsEmpty(cbo_moduleName.Value) Then MsgBox ("Module Name field empty!") Exit Sub End If End Sub
知道我在哪里犯错吗?
IsEmpty检查类型变量是否Variant包含特殊值Empty。
IsEmpty
Variant
Empty
您可能的意思是检查字符串是否为空字符串:
If Len(cbo_moduleName.Value) = 0 Then ... End If