vb中弹出式菜单的问题
PrivateSubDataGrid1_MouseDown(ButtonAsInteger,ShiftAsInteger,XAsSingle,YAsSingle)SetC...
Private Sub DataGrid1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Set Conn = New ADODB.Connection
Set rs = New ADODB.Recordset
Conn.Open "Provider = Microsoft.Jet.OLEDB.4.0;Data Source =" & App.Path & "\Database.mdb"
rs.CursorLocation = adUseClient
rs.Open "select 工作情况 from table1 where 寝室号='" & Text1.Text & "'", Conn, adOpenStatic, adLockBatchOptimisticDebug.Print rs!工作情况
If rs!工作情况 = 断网 Then
off.Enabled = False
If Button = 2 Then
PopupMenu operation
End If
End If
End Sub
其中off是弹出式菜单下的某个子目录
为什么这样做就没有反应啊?感觉逻辑上是对的啊 请各位大神指导一下 展开
Set Conn = New ADODB.Connection
Set rs = New ADODB.Recordset
Conn.Open "Provider = Microsoft.Jet.OLEDB.4.0;Data Source =" & App.Path & "\Database.mdb"
rs.CursorLocation = adUseClient
rs.Open "select 工作情况 from table1 where 寝室号='" & Text1.Text & "'", Conn, adOpenStatic, adLockBatchOptimisticDebug.Print rs!工作情况
If rs!工作情况 = 断网 Then
off.Enabled = False
If Button = 2 Then
PopupMenu operation
End If
End If
End Sub
其中off是弹出式菜单下的某个子目录
为什么这样做就没有反应啊?感觉逻辑上是对的啊 请各位大神指导一下 展开
1个回答
展开全部
断网 是变量还是字符串 如果是字符串应该是有双引号
If rs!工作情况 = "断网" Then
If rs!工作情况 = "断网" Then
追问
If rs!工作情况 = "断网" Then
a = 1
ElseIf rs!工作情况 = "联网/开电" Then
b = 2
End If
If a = 1 Then
off.Enabled = False
ElseIf b = 2 Then
off.Enabled = False
meon.Enabled = False
End If
off 和meon都是子目录 拜托帮我看看好不好?
追答
if a then
elseif b then
end if
满足a 就不会去判断b是否满足
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询