Private Sub Text2_Change() If Len(Text2) <= 2 Then If Len(Text2) = 2 And UCase(Text2) <> "A1" Then If Len(Text2) = 2 And UCase(Text2) <> "A2" Then If Len(Text2) = 2 And UCase(Text2) <> "A3" Then Text2 = "只能输入A1,A2,A3" End If End If End If End If End Sub
Private Sub Command1_Click() If Text1.Text = "a1" Or Text1.Text = "a2" Or Text1.Text = "a3" Then MsgBox "合法输入" Else MsgBox "请输入a1,a2,a3中的一个" End If End Sub
case A1,A2,A3
'处理
end select
If Len(Text2) <= 2 Then
If Len(Text2) = 2 And UCase(Text2) <> "A1" Then
If Len(Text2) = 2 And UCase(Text2) <> "A2" Then
If Len(Text2) = 2 And UCase(Text2) <> "A3" Then
Text2 = "只能输入A1,A2,A3"
End If
End If
End If
End If
End Sub
If Text1.Text = "a1" Or Text1.Text = "a2" Or Text1.Text = "a3" Then
MsgBox "合法输入"
Else
MsgBox "请输入a1,a2,a3中的一个"
End If
End Sub
=======================
用combo吧。。
作为三个不同的用户来使用呢?