Private Sub Command1_Click()
If Text1.Text = "" or text2.text="" or text3.text="" or text4.text="" Then
Msgbox "请输入字符,不能为空!"
Text1.SetFocus
End If
End Sub
'假设点击Command1,文本框为Text1-Text4
'这里有空格也不算空,如果要则加Trim
Private Sub Command1_Click()
If Text1.Text = "" Then
Msgbox "这个地方不能留空,谢谢合作!"
Text1.SetFocus
Exit Sub
End If
'//.. 以下重复上面代码,改变Text1为其他控件即可
'如果LZ用的是.Net 则过程声明不同,过程代码类似
End Sub
if text1.text="" or text2.text="" or text3.text="" or text4.text="" then
msgbox "Pls input your data"
else
...
end if
If text1.text="" or text2.text="" or text3.text="" or text4.text="" then
msgbox "Pls input your data":exit sub
if text1.text="" or text2.text="" or text3.text="" or text4.text="" then
msgbox"请完整输入!"
exit sub
end if