以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 附表设置联动之后模糊查询出现“未将对象引用设置到对象的实例。”报错 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=179691) |
-- 作者:comfortfoot -- 发布时间:2022/9/4 1:22:00 -- 附表设置联动之后模糊查询出现“未将对象引用设置到对象的实例。”报错 窗口中的table1关联到表1设置为附表,然后在附表的currentchanged中设置了联动 Dim dr As DataRow = e.Table.Current.DataRow Dim wz As Integer = Tables("RMT收据").FindRow(dr) If wz >=0 Then Tables("RMT收据").Position = wz End If textbox 的textchange 设置成 Dim txt As String = e.Form.Controls("TextBox7").Text Dim tbl As Table = Tables("病例_Table1") Dim tbl1 As Table = Tables("病例_Table2") If txt = "" Then tbl.Filter = "" tbl1.Filter = "" Else txt = "\'%" & txt & "%\'" tbl.Filter = "全名 Like " & txt & " or No Like " & txt tbl1.Filter = "na Like " & txt & " or 编号 Like " & txt End If ================== 当查询内容为空的时候,会出现 未将对象引用设置到对象的实例。”报错 请问如何修改代码 谢谢 |
-- 作者:有点蓝 -- 发布时间:2022/9/4 20:16:00 -- 看看注意事项:http://www.foxtable.com/webhelp/topics/0641.htm If e.Table.Current Isnot Nothing Then Dim dr As DataRow = e.Table.Current.DataRow Dim wz As Integer = Tables("RMT收据").FindRow(dr) If wz >=0 Then Tables("RMT收据").Position = wz End If End If
|
-- 作者:comfortfoot -- 发布时间:2022/9/6 1:13:00 -- 解决了谢谢大神,还是我自己看的不够仔细 |