此主题相关图片如下:360软件小助手截图20130930164102.jpg
我想通过选择tabcontrol页面,返回text,作为table的名,然后进行判断。现在提示没有我想要的结果。下面是代码。错在哪儿?各位大侠提供点思路。谢谢!
Dim tbc As WinForm.TabControl = e.Form.Controls("TabControl1")
Dim s As String = tbc.SelectedPage.Text
Dim t As Table = Tables(""" & s & """)
With Tables("基本情况")
If .Current Is Nothing Then
t.Filter = "False"
Else
t.Filter = "PatientsID = '" & .Current("patientsID") & "'"
End If
End With
t.OpenView("default")
Tables(""" & s & """).AllowEdit=False
If Tables(""" & s & """).count=0 Then
e.Form.Controls("btnfirst1").Enabled=False
e.Form.Controls("btnlast1").Enabled=False
e.Form.Controls("btnnext1").Enabled=False
e.Form.Controls("btnprev1").Enabled=False
e.Form.Controls("btnedit1").Enabled=False
e.Form.Controls("btndelete1").Enabled=False
e.Form.Controls("btnok1").enabled=False
e.Form.Controls("btncancel1").Enabled=False
ElseIf Tables(""" & s & """).count=1 Then
e.Form.Controls("btnfirst1").Enabled=False
e.Form.Controls("btnlast1").Enabled=False
e.Form.Controls("btnnext1").Enabled=False
e.Form.Controls("btnprev1").Enabled=False
e.Form.Controls("btnedit1").Enabled=True
e.Form.Controls("btndelete1").Enabled=True
e.Form.Controls("btnok1").enabled=False
e.Form.Controls("btncancel1").Enabled=False
Else
e.Form.Controls("btnfirst1").Enabled=True
e.Form.Controls("btnlast1").Enabled=True
e.Form.Controls("btnnext1").Enabled=True
e.Form.Controls("btnprev1").Enabled=True
e.Form.Controls("btnedit1").Enabled=True
e.Form.Controls("btndelete1").Enabled=True
e.Form.Controls("btnok1").enabled=False
e.Form.Controls("btncancel1").Enabled=False
End If
[此贴子已经被作者于2013-9-30 17:10:44编辑过]