如果 - 否则,跳过其他 [英] If-else,skipping else

查看:111
本文介绍了如果 - 否则,跳过其他的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

按照以下代码:


代码: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 Then

It''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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆