If System.Windows.Forms.Control.ModifierKeys = Keys.Control And e.Col.Name="检测内容" ‘*********************如果改成其他列,比如“备注”就没有问题
Dim ddr As DataRow = DataTables("通用检测价格表").Find("次分类 = '" & e.Row("试样名称") & "'")
If ddr Is Nothing Then
msgbox("请检查【试样名称】是否填写正确")
e.Cancel = True
End If
If ddr IsNot Nothing Then
Public_检测大类 = ddr("首分类")
Public_次分类=DDR("次分类")
Public_表名称=e.Table.name
Forms("窗口1").open
End If
End If
*******************以下是窗口1的代码
Dim nr1 As WinForm.TextBox = e.Form.Controls("详细内容")
Dim jg1 As WinForm.TextBox = e.Form.Controls("检测费")'
Dim sl1 As WinForm.TextBox = e.Form.Controls("检测数量")
Dim nr2 As WinForm.TextBox = e.Form.Controls("试样名称")
Dim jg2 As WinForm.TextBox = e.Form.Controls("加工费")
Dim sl2 As WinForm.TextBox = e.Form.Controls("试样数量")
Dim dr1 As Row= Tables(public_表名称).current
dr1("检测内容")=iif( sl1.text>0,(nr1.text & "*" & sl1.text),"")
dr1("加工内容")=iif(sl2.text>0,(nr2.text & "*" & sl2.text),"")
dr1("检测费")=jg1.text
dr1("加工费")=jg2.text
如果双击的是“检测内容”列,dr1("检测内容")=iif( sl1.text>0,(nr1.text & "*" & sl1.text),"")就没有结果。双击其他列打开窗口,就没有问题
[此贴子已经被作者于2020/2/10 20:30:13编辑过]