|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
空表是由空行生成的。批量导入时,本身应该在源头上控制。例如,先判断记录数是否为空,不为空再导入。
当然,Access也有一个叫数据库文档管理器的神器可以解决这个问题。点击“数据库工具”,然后点选这个。
最后设置为横向,导出到Word即可。
页码数对应的就是表的数量。左上角有表名,左下方的recorcount即为记录数。直接按下Ctrl+F查找“recordcount”就好了。
当然,你也可以写VBA。大体是这样
dim rst as new adodb.recordset
dim rst1 as new adodb.recordset
dim tbl as DAO.TableDef
for tbl in DAO.TableDefs
if not tbl.name like '*sys*' and tbl.name<>"统计表" then
strSQL="select count(*) from" & tbl.name
rst.open strSQL,currentproject.connection,1,3
rst1.open"select * from 统计表",currentproject.connection,1,3
rst1.addnew
rst1("表名")=tbl.name
rst1("记录数")=rst(0)
rst1.update
rst1.close
rst.close
end if
next
|
|