在窗口里,添加了页面集合控件,有两个选项卡,每个选项卡里面都有一个Listview,分别为listview1/listview2;对于这两个listview 他们的click时间我都编辑了如下;当单击listview1某行后,再切换到listview2时(来回切换),就会出错:错误代码如下:
.NET Framework 版本:2.0.50727.5485
Foxtable 版本:2017.8.19.1
错误所在事件:窗口,医生预约,ListView2,Click
详细错误信息:
此行已从表中移除并且没有任何数据。BeginEdit() 将允许在此行中创建新数据
*********************** listview 的click 时间代码如下
Dim a,b As String
Dim Sum1,Sum2,Sum3,Sum4 As Integer
Dim lvw As WinForm.ListView = e.Form.Controls("ListView1")
Dim vr As WinForm.ListViewRow = lvw.Current '获取ListView中选定的行
If vr Is Nothing Then '如果不存在当前行,也就是内有选定任何一行
Return
End If
Dim dr As DataRow = vr.tag '获取此行对应的DataRow
e.Form.Controls("TextBox4").Text = dr("病人姓名")
e.Form.Controls("TextBox5").Text = dr("病历号")
e.Form.Controls("TextBox6").Text = dr("预约项目")
e.Form.Controls("TextBox10").Text = dr("预约电话")
e.Form.Controls("TextBox9").Text = dr("备注")
a = dr("病人姓名")
b = dr("病历号")
Sum1 = DataTables("预约表").Compute("Count(病人姓名)", "[病历号] = '" & b & "' And [病人姓名] = '" & a & "' ")
Sum2 = DataTables("预约表").Compute("Count(病人姓名)", "[病历号] = '" & b & "' And [病人姓名] = '" & a & "' And [状态] = '过期' ")
Sum3 = DataTables("收费明细").Compute("Sum(实收费用)", "[病历号] = '" & b & "' And [患者姓名] = '" & a & "' And [状态] = '已完成' ")
Sum4 = DataTables("收费明细").Compute("Sum(欠费)", "[病历号] = '" & b & "' And [患者姓名] = '" & a & "' And [状态] = '已完成' ")
e.Form.Controls("TextBox7").Text = Sum1
e.Form.Controls("TextBox8").Text = Sum2
e.Form.Controls("TextBox11").Text = Sum3
e.Form.Controls("TextBox01").Text = Sum4
*********************求助错误在哪里?