如果 - 否则,跳过其他 [英] If-else,skipping else
问题描述
按照以下代码:
代码:vb
如果mesge = vbOK那么
rs.Open select * from empdetail where name =''" &安培; mName& "''",conn,adOpenStatic,adLockOptimistic
txtid.Text = rs!id
txtid.Enabled = False
Else
txtid.Text =""
txtid.Enabled = True
结束如果
rs 。关闭
设置rs = Nothing
从控制器没有移动到其他地方开始?
有什么问题代码?任何人请解释。
在此声明之前发生了什么:
如果mesge = vbOK那么
在此声明之前发生了什么:
如果mesge = vbOK那么
这是从listvieew中删除特定选定项目的代码,其中mesge被声明为Integer。
展开 | 选择 | 换行 | 行号
我认为你应该使用vbYesNo insteaed of vbOKCancel。
Follow the code:
code:vb
If mesge = vbOK Then
rs.Open "select * from empdetail where name = ''" & mName & "''", conn, adOpenStatic, adLockOptimistic
txtid.Text = rs!id
txtid.Enabled = False
Else
txtid.Text = ""
txtid.Enabled = True
End If
rs.Close
Set rs = Nothing
starts from if the control not moving to else?
What''s wrong with the code? Anybody please explain.解决方案Whats going on before this statement:
If mesge = vbOK Then
Whats going on before this statement:
If mesge = vbOK ThenIt''s a code to remove a particular selected item from a listvieew, where mesge is declared as Integer.
Expand|Select|Wrap|Line Numbers
I think you should use vbYesNo insteaed of vbOKCancel.
这篇关于如果 - 否则,跳过其他的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文