以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 请老师指教如下代码出错 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=194258) |
-- 作者:fvcfox -- 发布时间:2024/11/22 20:56:00 -- 请老师指教如下代码出错 Dim s As String Dim tb As Table = Tables("物料清单C") s = tb.Current("物料") Do While tb.Current.Parent.Index > -1 MessageBox.Show(tb.Current.Parent.Index) tb.Position = tb.Current.Parent.Index s = tb.Current("物料") & "\\" & s Loop MessageBox.Show(s) 将Do While tb.Current.Parent.Index > -1 改成:Do While tb.Current.Parent isnot nothing 不执行循环 [此贴子已经被作者于2024/11/22 20:58:13编辑过]
|
-- 作者:y2287958 -- 发布时间:2024/11/22 21:27:00 -- 先判断一下当前行是否存在 |
-- 作者:有点蓝 -- 发布时间:2024/11/23 9:15:00 -- http://www.foxtable.com/webhelp/topics/0445.htm Dim s As String Dim tb As Table = Tables("物料清单C") Dim r As Row = tb.Current If r IsNot Nothing Then s = r("物料") r = r.Parent Do While r IsNot Nothing MessageBox.Show(r.Index) tb.Position = r.Index s = r("物料") & "\\" & s r = r.Parent Loop MessageBox.Show(s) End |