0
我有用户窗体,有1个组合框和几个文本框。 组合框1 =类型的应用程序(7个不同的结果),如名字,姓氏,城镇,邮编等 文本字段vba,outlook,用户表单,如果comebox和文本字段
按下确定按钮后,我想提示用户如果强制字段丢失。
1个选择必填字段为字段1,字段2和字段3 只有3场只申请1和2选择2 6 等
奇怪的是,如果我选择的东西我没有定义在这一部分,我选择了价值4或5我仍然得到消息。 我错过了什么?
Private Sub CommandButton1_Click()
If UserForm2.ComboBox1T.Value = "1.New Application" _
And TextBox1.Text = "" _
Or TextBox2.Text = "" _
Or TextBox3.Text = "" _
Then
MsgBox ("Fill in all mandatory Fields")
Exit Sub
End If
If UserForm2.ComboBox1T.Value = "2.Old Application" _
And TextBox1.Text = "" _
Or TextBox2.Text = "" _
Then
MsgBox ("Fill in all mandatory Fields")
Exit Sub
End If
If UserForm2.ComboBox1T.Value = "3.Somethingelse" _
And TextBox1.Text = "" _
Or TextBox2.Text = "" _
Then
MsgBox ("Fill in all mandatory Fields")
Exit Sub
End If
啊,我知道你错过了什么。你错过了[this](https://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work/5235#5235),因为那些花费宝贵时间回答你的问题的人。 – Tehscript
我的错误,全部排序。我刚开始用stackoverflow,并不知道如何一切正常。 – folkstorm