1. CheckRecords 函数
功能:CheckRecords 函数可用于判断某表中是否存在记录。
语法:CheckRecords("表名称"),如果返回值为True,则表示该表有至少一条记录,如果返回值为False,则表示该表没有记录
示例:
我们假定有表 tbl销售明细
if CheckRecords("tbl销售明细")=True then
msgbox "该表存在记录"
else
msgbox "该表不存在记录"
endif
2. fExistTable 函数
功能:fExistTable 函数可用于判断当前数据库中是否存在某个表。
语法:fExistTable("表名称"),如果返回值为True,则表示该表存在,如果返回值为False,则表示该表不存在
示例:
if fExistTable("tbl销售明细")=True then
msgbox "该表存在"
else
msgbox "该表不存在"
endif
3. Acchelp_GetColumnName 函数
功能:Acchelp_GetColumnName 函数可用于获得表或查询中的字段名称,用分号隔开,用于组合框或列表框的行来源,组合框或列表框的行来源类型必须选择值列表。
语法:Acchelp_GetColumnName("表或者查询名称")
示例:
dim strSQL as string
strSQL = Acchelp_GetColumnName("tbl销售明细")
debug.print strSQL