窗口CurrentChanged事件中写入下面代码,为什么只执行红色部分代码?
If e.Table.Current Is Nothing Then '如果Current为Nothing
Return
Else
'''显示或关闭菜单按钮
For Each dr As Row In CurrentTable.Rows
Dim sit As WinForm.StripItem = e.Form.Strips("主菜单").Items("txbf")
Dim ns As Integer = DataTables("图像明细").Compute("Count([_Identify])","图像编号 = '" & dr("附件编号") & "'")
If ns > 0 Then
sit.Enabled = True
Else
sit.Enabled = False
Return
End If
Dim pstr As WinForm.StripItem = e.Form.Strips("主菜单").Items("Pdf_open")
Dim pfil As String = "文件名称 = '" & dr("文件名称") & "' And 文件附件编号 = '" & dr("附件编号") & "' And 文件后缀 = '.pdf'"
Dim pcnt As Integer = DataTables("资料明细").Compute("Count([_Identify])",pfil)
If pcnt > 0 Then
pstr.Enabled = True
Else
pstr.Enabled = False
End If
Dim wstr As WinForm.StripItem = e.Form.Strips("主菜单").Items("Word_open")
Dim wfil As String = "文件名称 = '" & dr("文件名称") & "' And 文件附件编号 = '" & dr("附件编号") & "' And 文件后缀 = '.doc'"
Dim wcnt As Integer = DataTables("资料明细").Compute("Count([_Identify])",wfil)
If wcnt > 0 Then
wstr.Enabled = True
Else
wstr.Enabled = False
End If
Next
End If