终于看明白了一些,下面代码放在命令窗口看看结果: dim sg as string for i as integer = 0 to tables("表B").count-1 if tables("表B")(i)("编号") = tables("表A").current("编号") and right(tables("表B")(i)("施工编号"),1) = "1" sg = sg & tables("表B")(i)("施工编号") & chr(13) & chr(10) end if next messagebox.show(sg,"请看")
这样也行: dim sg as string for i as integer = 0 to tables("表A.表B").count-1 if tables("表A.表B")(i)("编号") = tables("表A").current("编号") and right(tables("表A.表B")(i)("施工编号"),1) = "1" sg = sg & tables("表A.表B")(i)("施工编号") & chr(13) & chr(10) end if next messagebox.show(sg,"请看")