呵呵写了个vb 验证代码
碰到错误时怎么让他不执行下一句比如:用户空时,就不要再往下验证密码Private Sub cmdOK_Click()
'用户名是否为空
If txtUserName = "" Then
MsgBox "未输入用户名"
End If
If txtPassword = "" Then
MsgBox "未输入密码!"
End If
end sun
碰到错误时怎么让他不执行下一句比如:用户空时,就不要再往下验证密码Private Sub cmdOK_Click()
'用户名是否为空
If txtUserName = "" Then
MsgBox "未输入用户名"
End If
If txtPassword = "" Then
MsgBox "未输入密码!"
End If
end sun
解决方案 »
- 急!!请各位大侠帮个忙吧
- 如何为VB 的RichTextBox附加字符串
- 还有个问题在VB中怎么单击近钮让它发声音呢!
- 超级简单的问题界面上的菜单在设计时怎么去掉????
- Command的小问题
- 数据库端口号改了,连接不上了。请教!!!
- 关与listview控件问题,救急
- set DataGrid1.DataSource = rs DataGrid1为什么时空的?
- 关于update的一个问题
- 哪些windows消息可以触发窗体标题栏鼠标拖动的事件,我拦截了许多Windows消息,但不知哪些是我要找的,你赐教.
- 请问怎样设置select语句按年份和期数的字段选择记录(好像要选择2003第33期到2004年的第56期之间的记录)
- 急!急!各位救命!!!
'用户名是否为空
If txtUserName = "" Then
MsgBox "未输入用户名"
Exit Sub
End If
If txtPassword = "" Then
MsgBox "未输入密码!"
End If
end sub
'用户名是否为空
If txtUserName = "" Then
MsgBox "未输入用户名" exit sub'退出过程
End If
If txtPassword = "" Then
MsgBox "未输入密码!"
End If
end sun
If txtUserName = "" or txtPassword = ""
Then
MsgBox "未输入用户名或未输入密码!"
textusername.setfocus
End If
end sub